Created
May 10, 2010 01:16
-
-
Save nhaskins/395555 to your computer and use it in GitHub Desktop.
wordpress get most recent post by category
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 $my_query = new WP_Query('category_name=yournamehere&posts_per_page=1'); | |
while ($my_query->have_posts()) : $my_query->the_post(); | |
$do_not_duplicate = $post->ID; ?> | |
<?php the_title(); ?> | |
<?php the_content(''); ?> | |
<?php endwhile; ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment