Grow your CSS skills. Land your dream job.

Recent Posts Specific Category

  • # August 2, 2010 at 10:08 am

    Does anyone know how I can display recent posts from a specific category with a short bit of code? I’m using WordPress if that helps.


    # August 2, 2010 at 6:25 pm

    query_posts is the function you’re looking for:

    <?php query_posts(‘cat=5′); ?>
    <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
    <?php the_content(); ?>
    <?php endwhile; endif; ?>

    Just gotta find the id of the category you’re looking to show.

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.

*May or may not contain any actual "CSS" or "Tricks".