Skip to content

Instantly share code, notes, and snippets.

@ZachMoreno
Created May 29, 2014 19:00
Show Gist options
  • Save ZachMoreno/e00f0d09db3cb7001a3c to your computer and use it in GitHub Desktop.
Save ZachMoreno/e00f0d09db3cb7001a3c to your computer and use it in GitHub Desktop.
<ul>
<?php
$topThreePostsArgs = array(
'post_type' => 'coastal_news'
);
// Query the Coastal News post type -->
$my_query = new WP_Query( $topThreePostsArgs );
// While there are Coastal News items, loop through them as list items
while ($my_query->have_posts()) : $my_query->the_post();
// Don't show duplicates
$do_not_duplicate = $post->ID;
?>
<li><?php the_title(); // or any other echo get(''); calls ?></li>
<?php endwhile; ?>
</ul>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment