Latest posts in sidebar


/ Published in: PHP
Save to your folder(s)



Copy this code and paste it in your HTML
  1. <h3>Recent Stories from Dental Blog</h3>
  2. <ul>
  3. <?php
  4. $archive_query = new WP_Query('showposts=4');
  5. while ($archive_query->have_posts()) : $archive_query->the_post(); ?>
  6. <li><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a></li>
  7. <?php endwhile; ?>
  8. </ul>

URL: http://wordpress.org/support/topic/recent-posts-in-sidebar

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.