Posted By

creator on 12/01/08


Tagged

wordpress sidebar category pod


Versions (?)

Who likes this?

13 people have marked this snippet as a favorite

nerdfiles
wirjo
SmpleJohn
rickfu
bryandease
sandynata
achilles283
raz
marclarr
booski
moopee1176
qubestream
dedi49


WordPress: Latest Posts from Category


 / Published in: PHP
 

Used to display the latest X number of posts from the specified category.

  1. <div class="pod">
  2. <h2>Latest Announcements</h2>
  3. <ul>
  4. <?php query_posts('cat=5&showposts=10'); ?>
  5. <?php while(have_posts()) : the_post(); if(!($first_post == $post->ID)) : ?>
  6. <li>
  7. <a href="<?php the_permalink() ?>" rel="bookmark" title="Permalink: <?php the_title(); ?>"><?php the_title(); ?></a>
  8. </li>
  9. <?php endif; endwhile; ?>
  10. </ul>
  11. </div>

Report this snippet  

You need to login to post a comment.