WordPress.org

Ready to get started?Download WordPress

Forums

Help: Categories, The Loop, exclusion, and the Sidebar (1 post)

  1. Kyle Skrinak
    Member
    Posted 5 years ago #

    All,

    I have set up a template page that will limit its included posts to a category using the following:

    <?php
    $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
    query_posts('cat=4&showposts='.get_option('posts_per_page'). '&paged=' . $paged);
    ?>

    It works as I expect it to; great. However, in my sidebar is a "Recent Posts" widget that needs to be able to see posts in category ID #1, not 4, inorder to work properly. The query_posts function that i have at the top of the page, strips those posts out of the loop.

    How can I get the "Recent Posts" widget to show posts in Category 1?

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.