Skip to content

Instantly share code, notes, and snippets.

@feedmeastraycat
Created December 6, 2012 11:11
Show Gist options
  • Save feedmeastraycat/4223753 to your computer and use it in GitHub Desktop.
Save feedmeastraycat/4223753 to your computer and use it in GitHub Desktop.
WordPress: Latest posts with date
<?php
$lq = new WP_Query(array('posts_per_page' => 10));
if ( $lq->have_posts() ): while ( $lq->have_posts() ): $lq->the_post(); ?>
<?php the_time('Y-m-d') ?> <a href="<?php the_permalink(); ?>"><?php the_title(); ?></a><br>
<?php endwhile; endif;
wp_reset_postdata();
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment