Last active
August 29, 2015 14:26
-
-
Save celticwebdesign/80fcff37b00a8e48acb0 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$args = array( | |
'post_type' => 'notices-mariners', | |
'post_status' => 'publish', | |
'posts_per_page' => 2, | |
'meta_key' => 'mariners_date_selected', | |
'orderby' => 'meta_value_num', | |
'order' => 'ASC' | |
); | |
// The query | |
$child_query = new WP_Query($args); | |
// The loop | |
if( $child_query->have_posts() ) : while ( $child_query->have_posts() ) : $child_query->the_post(); ?> | |
<!-- article --> | |
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>> | |
<div class="row"> | |
<div class="col-md-9"> | |
<div class="date"><?php echo get_field('mariners_date_selected'); ?></div> | |
<div class="notice"><?php echo get_the_title(); ?></div> | |
<?php | |
$rows = get_field('mariners_list_repeater', get_the_ID()); | |
if($rows) { | |
echo "<!-- mariners_list_repeater -->"; | |
echo "<ul class='mariners_list'>"; | |
foreach($rows as $row) { | |
echo "<li class='item'>"; | |
echo $row['mariners_list_item']; | |
echo "</li>"; | |
} | |
echo "</ul>"; | |
echo "<!-- /mariners_list_repeater -->"; | |
} | |
if( get_field('mariners_notice_pdf', get_the_ID()) ) { | |
echo '<a href="'.get_field("mariners_notice_pdf", get_the_ID()).'" title="'.get_the_title().'" class="view-notice" target="_blank">View Notice</a>'; | |
} | |
?> | |
</div> | |
</div> | |
</article> | |
<!-- /article --> | |
<?php endwhile; endif; | |
wp_reset_postdata(); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment