Resetting the query_posts for a search (3 posts)

  1. AdiiFreelancer
    Posted 8 years ago #

    Hey everyone! I really need some help, as I'm complete stumped on how to solve my little problem... :)

    I'm building a CMS powered by WP - you can see it here - http://www.sheqafrica.com. The structure of the site's template looks like this:

    <!-- START HEADER -->

    1. Use query_posts() to call the latest featured article from a specific category

    2. Use another query_posts() to call the latest blog posts from another category

    <!-- END HEADER -->

    <!-- LEFT SIDEBAR -->

    <!-- MAIN CONTENT -->

    Again, I'm using query_posts() to call just the page specific posts or page content

    <!-- END MAIN CONTENT -->

    <!-- RIGHT SIDEBAR --->

    So this is my problem:

    Everything works fine on all the content pages(index.php, single.php, page.php and archive.php), except for the search.php page. I've experienced this problem before, when using query_posts() and then I would just remove it from the search.php page. Problem is, I can't remove the two query_posts() in the header, since that's the ONLY way of pulling content there.

    So how do I solve this problem? I haven't found any info regarding possibly resetting the query_posts() that starts just before the search results' loop... Any ideas?

    I would appreciate any help greatly!



  2. mo2007
    Posted 8 years ago #

    sorry if I am not helping...but how did you do your single.php...I have a problem where I use 3 query_posts in the header.php to call 3 different category posts....but when I click on a post, it doesn't show...my single.php is an exact duplicate of index.php which I think does not make sense to me because I am calling specific category posts, but this should not apply to single.php as it is supposed to only show the selected post.

    hope u understood my problem...thanx in advance :)

  3. mo2007
    Posted 8 years ago #

    oh and I found a post here about stopping query_posts

Topic Closed

This topic has been closed to new replies.

About this Topic