Support » Fixing WordPress » Question About Multiple Loop Conditional

  • Resolved pufftenticle


    I am attempting to dictate the number of post excerpts seen on category templates. I’m reading the multiple loop page in the codex, but not really understanding what I’m doing wrong. I have found this example:

    // Get the last 10 posts in the special_cat category.
      <?php query_posts('category_name=special_cat&showposts=10'); ?>
      <?php while (have_posts()) : the_post(); ?>
        <!-- Do special_cat stuff... -->
      <?php endwhile;?>

    I used this for the ‘special category’:

    <?php query_posts('category_name=11&showposts=4'); ?>

    but that returns a white page (just in the content area, the sidebars are fine).

    I tried again using the rewind:

    <?php rewind_posts(); ?>

    still white page. help ?

Viewing 4 replies - 1 through 4 (of 4 total)
  • I gave up too soon.

    replaced with this:

    <?php query_posts('category_name=NAMEOFCATEGORY&showposts=4'); ?>

    and everything is great.

    spoke too soon ? again ?

    that php call above is pulling up the correct posts in the correct category and displaying them on the correct template. however, the movement to page 2 and 3 and beyond only brings up the same page. i’m using Lester Chan’s WP-PageNavi2.20 plugin.

    any ideas ?

    Using query_posts kills the next/prev navigation – most of the times. There was some additional code posted how to correct that… I just can’t remember where.

    As another idea: why not use the CQS (custom query string) plugin to set the number of posts shown in different views?

    i didn’t even think of that. i already had it installed. what an easy fix. thanks a bunch !

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Question About Multiple Loop Conditional’ is closed to new replies.