Skip to content

Instantly share code, notes, and snippets.

@chasereeves
Created April 2, 2011 17:47
Show Gist options
  • Save chasereeves/899698 to your computer and use it in GitHub Desktop.
Save chasereeves/899698 to your computer and use it in GitHub Desktop.
Latest Posts Loop
//=========================================================== Latest Posts Loop
function widget_latest_posts() {
$widget_latest_posts = new WP_Query('posts_per_page=3');
while ($widget_latest_posts->have_posts()) : $widget_latest_posts->the_post(); ?>
<div>
<h4><a href="<?php the_permalink() ?>" title="<?php the_title() ?>"><?php the_title()?></a></h4>
<?php the_excerpt() ?>
<p class="widget_latest_posts_meta">Posted on <a href="<?php the_permalink() ?>" title="<?php the_title() ?>"><?php the_date() ?></a></p>
</div>
<?php endwhile;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment