The Support Forums will be in read-only mode for a scheduled maintenance window on 01 September 2016 14:00 UTC - 20:00 UTC. More information.

how to save the pages/results in multiple queries? (2 posts)

  1. parasew
    Posted 11 years ago #

    i have a question regarding multiple loops: as i am using several queries to show the last entries in various categories, but the posts_nav_link seems to lose the information about the previous entries. if i comment out the other queries, everything works fine.

    any way to store the information about the results, so i can put them back later? which variable to use? any idea?

    thanks a lot!

  2. parasew
    Posted 11 years ago #

    i solved the problems with output buffering, see http://wiki.wordpress.org/?pagename=HowTo%2FUseTemplatesInAnyDirectory for some more information

    for my special case with the previous/next links, the following code would work:

    <?php global $searchnavigation;
    ob_start(); ?>
    <div class="search_navigation">
    <div class="alignleft_search"><?php posts_nav_link('','','� Previous Entries') ?></div>
    <div class="alignright_search"><?php posts_nav_link('','Next Entries �','') ?></div>
    <?php $searchnavigation = ob_get_contents();

    for later use you would just print($searchnavigation);

Topic Closed

This topic has been closed to new replies.

About this Topic