Working on a ‘Featured’ section
I’d like to create a ‘featured’ box on my home page that works like this:
If there is a post in both its own category AND the ‘featured’ category, show it. When only in its own category, don’t show it.
If there are NO posts in the ‘Featured’ category, show latest post from categories x,y,z.
I was looking at using
query_posts(array('category__and' => array(x,featured)));but it needs to be (x,featured)(y,featured)(z,featured) etc to include all possible combinations, which isn’t very elegant or futureproof.
Using conditional ‘if’ statements looks like the way, but I’m not sure which functions to use or how to use them
Can anyone guide me a little on this? Is there a simple way of doing it that I’ve overlooked?
- The topic ‘Working on a ‘Featured’ section’ is closed to new replies.