• Resolved roakin

    (@roakin)


    if posted this in the section Themes and Templates previously, but didn’t get an answer .. i think it also fits into this section

    i’m developing a theme template for news entries. the template is a page template where some informations on the top can be entered in the page admin. then i have a lot of posts with job informations and i need to display them inside the page. therefore i’m using ‘query_posts()’

    the problem is that on the bottom of the template i call get_sidebar() and in the sidebar there’s a navigation. my problem is that after the job list i have no postID of the page available (well of course i can save it in a var on top of query_posts() but i don’t know how i can set the page post again so that the navigation in the sidebar can be displayed directly.

    my template looks this way right now

    <?php get_header() ?>
    <div id="container">
      <div id="content">
        <?php the_post() ?>
        <div id="post-<?php the_ID() ?>">
          <?php the_title() ?>
        </div>
        <ul class="news">
        <?php
          query_posts('cat=9&orderby=date&order=DESC');
          if (have_posts()) : while (have_posts()) : the_post(); ?>
            <li><?php the_title(); ?></li>
          <?php endwhile; endif; ?>
        </ul>
      </div>
    </div>
    <?php get_sidebar() ?>

    thanks in advance

  • The topic ‘right post for sidebar when using query_posts inside page’ is closed to new replies.