Someone in our design team has suggested a fairly tricky layout, and I’m hoping to get some help (snippet suggestions if possible) of how I would achieve this…
I need to split my category archive (category.php / archive.php) in the following way:
1. Display one featured post (tag = “featured”) at the top of the page
2. Display two posts tagged as “hot”
3. Display two popular posts
4. Then display two latest posts (the ‘regular’ archive, which could include articles form the above, but only display 2)
For displaying only 2 of the latest articles, I have the following down…
I’ll admit to having accidentally pressed ‘post’ instead of ‘save draft’, so you might’ve had a reason for posting that rather unnecessary link in your reply. You might want to rethink that approach in future, as complete newcomers to the forum (who are probably already intimidated by having to ask pros for help) would be scared off…
That said, I’ve often found when giving an elaborate explanation of my problem on any forum, the length determines whether or not you even get a reply. Thanks for the reply, albeit what it is.
I’ve included the bits of code I forgot to paste. Again, any help would be appreciated.
You should be able to run as many loops as you like using WP_Query – I’m not 100% sure what the problem is that you are experiencing. I’d say give it a go and if you stumble, we’ll be able to answer those questions!
Okay, so I have come unstuck on this query thing and need some help, please?
In my category.php file, I need to run a few queries (using WP_Query) in order to display the following:
* One post from the the current category that is tagged as “featured”
* Two posts from the current category that is tagged “hot”
* Two posts from the current category
So my questions are:
1. Can you use QP_Query to find articles tagged with a particular tag, but only from a particular category? i.e. Category = DVD and Tag = Featured?
2. Can you do the above for the currently viewed category? i.e. When browsing DVD, the category.php template is called, but I only want to show featured posts from that category…