WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. parasew
    Member
    Posted 9 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
    Member
    Posted 9 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>
    </div>
    <?php $searchnavigation = ob_get_contents();
    ob_end_clean();

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

Topic Closed

This topic has been closed to new replies.

About this Topic