How to reset or rewind query_posts
-
I have a site that has a sidebar menu that ends with this code:
<li>
<?php query_posts('page_id=48'); ?>
<a href="<?php echo get_permalink(48); ?>"> <?php the_title(); ?>
</a> </li>
</ul>The problem I am encountering is that after this menu I’m calling specific post excerpts with “more” links to those specific posts. What’s wrong is that all “more” links on my page go to the last item on my sidebar menu which is page id=48. How do I reset my query_posts so that my more links will work? Here’s the beginning of the code that follows bringing in the sidebar (what it is trying to do next)
<!-- CONTENT STARTS HERE -->
<div id="content">
<?php page_content_only; ?>
<?php if (have_posts()) : ?>
<?php while (have_posts()) : the_post(); ?>
<!-- <div class="post" id="post-<?php //the_ID(); ?>"> -->
<!-- Uses get-a-post plugin. See Admin for additional informaton -->
<div id="hp_story_1">
<!-- Get post #66 (home_page_1 story -->
<?php get_a_post(66); ?>
<div id="hp_story_1_excerpt">
<?php the_excerpt(); ?>
<span class="moretext1"><a href="<?php the_permalink(); ?>">more...</span></a>
</div> <!-- END OF EXCERPT -->Any help will be greatly appreciated!
- The topic ‘How to reset or rewind query_posts’ is closed to new replies.