• By now, i know about half a dozen ways to realize multiple loops. But i haven’t managed to keep the “orinial” (the one with the content which should be on the site) loop for the site.

    How is it possible to recall the “original” loop after calling “special” loops before with code e.g.

    <?php $posts = get_posts(‘category=1&numberposts=1’); ?>
    or
    <?php query_posts(‘cat=1&showposts=1’); ?>
    or
    <?php $my_query = new WP_Query(‘cat=1&showposts=1);>

    In my special case i have 4 “special” loops before and 2 after the position where the “otiginal” loop should be displayed.

    Has someone a solution or a hint for me?

    Thx
    Mo

    PS: the search only shows me the some ten posts every time i click “next”…so it is not really helpfull for me 🙁

Viewing 1 replies (of 1 total)
  • On your first custom loop, avoid using $posts (call it $my_posts or $cat_one_posts or whatever). $posts is a special variable, actually an object, in WordPress which holds the default posts from your “original” loop, and you’re whacking this when assigning it to a get_posts() call.

    On the second I can’t help. query_posts() really should only be used to reset The Loop (i.e. the “original”).

    And the final custom loop should not interfere with the default post loop. Passing a whole new WP_Query class (to a different var from $posts) bypasses it completely.

    EDIT: Removed a bit here; misread your PS.

Viewing 1 replies (of 1 total)

The topic ‘Keep the “original” Loop while using multiple Loops’ is closed to new replies.