I have a theme where I’m listing the latest posts of a specific category in the header. But the problem I’ve run into is that when I use query_posts(‘showposts=1&cat=3’), the main Loop is also affected, and will only show one post of that category.
Also affected are pages and categories which will show whatever query_posts got previously.
Is there a workaround for this?
What I’m essentially trying to do is post the latest post from a specific category, and the code for that comes before the main Loop which is supposed to list the latest posts overall. By using query_posts before the Main loop, it causes the main loop to also display what query posts called up.
I’ve tried query_posts(‘showposts=10’) to no avail. It works fine for the home page, but when it comes to individual pages and categories, the posts it displays are the same.
- The topic ‘Multiple query_posts’ is closed to new replies.