• Resolved mike888

    (@mike888)


    I have two loops running on my theme. The first is to pull all sticky posts and the second is to pull all remaining non sticky posts.

    I was able to get this working but unfortunately when I try and view the category page it disregards them and displays all the posts as they would appear on the index.

    So for example I have categories Apples, Oranges, and Plums. On the index all of them show up as they should with the stickies at the top and the rest below. But when I view the Apples category page I get the stickies at the top and the rest of the posts below but it is still pulling them from Oranges and Plums.

    The only parts of the them I modified were adding a second loop and the two query posts below.
    To call the sticky posts:

    query_posts(array(‘post__in’=>get_option(‘sticky_posts’), $query_string . ‘orderby’=>rand));

    The Rest of my Stuff:

    <?php rewind_posts(); ?>
    <?php wp_reset_query(); ?>

    Final Query to call the rest.

    $sticky=get_option(‘sticky_posts’);
    $args=array(

    ‘caller_get_posts’=>1,
    ‘post__not_in’ => $sticky,
    ‘orderby’=>rand,
    );
    query_posts($args);

    If you see anything that would allow category sorting pages to work again that would be so amazing. I have spent hours looking this over to no avail 🙂

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter mike888

    (@mike888)

    Just checking to see if anyone had a chance to see this 🙂 Happy Holidays everyone.

    I don’t see anything in the code that would limit the category. Is this the code that gets called when you click on a category?

    If you can post a link to the site, and any instructions on how to see the problem, that would help.

    Thread Starter mike888

    (@mike888)

    Thanks for your help.
    In the end my solution was to create category specific php pages and use the just attached the category id to each page in the query. Not ideal but with a set number of categories planned it seems to be best.

    For those that find this later running the query string by itself allowed the categories to display properly and running the array for the stickies allowed me to display just the stickies but without categories working. I suspect what I did wrong has to do with how they were combined.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Category Page Displaying All Category Posts’ is closed to new replies.