The Loop and Cross-Category Posts.
-
Hi guys,
On a site I’m doing for a record label I’ve set up the sidebar to show a list of Gigs if on any Artist’s page (post) using The Loop as follows:
<?php query_posts(‘category_name=gigs&showposts=5’); while(have_posts()) : the_post(); ?>
This is pretty simple stuff, but now I would like to only display that particular Artist’s Gigs.
The logic I’ve figured out for this is to add the Gigs to both the “Gigs” category and a category named after the Artist. I would also need to add the Artist to both the “Artists” category and it’s own category named after the Artist.
So then I would only need the code to say:
<IF post is in “artist_name” AND “gigs” display here>
Can’t figure it out for the life of me though, can any of you guys help?
The topic ‘The Loop and Cross-Category Posts.’ is closed to new replies.