Show recent post by category

– Show recent Posts

    <h2>Recent Posts</h2>

    <ul>
    <?php get_archives(‘postbypost’, 6); ?>
    </ul>

– Show recent posts from specific category ?

    <ul>
    <?php $recent = new WP_Query(“cat=1&showposts=5”);
    while($recent->have_posts()) : $recent->the_post();?>
    <li><a href=”<?php the_permalink() ?>” rel=”bookmark”>
    <?php the_title(); ?>
    </a></li>
    <?php endwhile; ?>
    </ul>

Posted via email from Netlex’s codebox

Advertisements

~ by netlex on October 8, 2009.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: