[resolved] Showing select category (3 posts)

  1. dbisbing
    Posted 5 years ago #

    I have a sidebar that I am calling a particular category into and only the most recent 3 posts. Not sure how to modify the code I am working with.

    $recent = new WP_Query();
    $recent -> query('showposts=3');
    while($recent -> have_posts()) : $recent -> the_post();

    I'm am pretty new to this all so any help would be wonderful!

  2. wprelief
    Posted 5 years ago #

    The code above will only pull the 3 most recent articles. If you want the three most recent from a category, add &cat=x where x is the ID number for the category you want to pull articles from.

  3. dbisbing
    Posted 5 years ago #


Topic Closed

This topic has been closed to new replies.

About this Topic