• 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?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter heriz

    (@heriz)

    NB, this could be achieved using the ‘sticky’ or ‘announcement’ features, but I have an events section which conflicts with these, for some reason I don’t entirely understand.

    The idea is that if we want an important post to remain on the front page for longer, while continuing to post – we simply place it in the ‘featured’ category (AS WELL AS the normal category) for as long as needed.

    I may be describing a well known technique, but I’ve not seen it mentioned before.

    Thread Starter heriz

    (@heriz)

    No-one?

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Working on a ‘Featured’ section’ is closed to new replies.