Show content based on taxonomy
-
Hi – I’d like to display a javascript lightbox or button in the sidebar when a user views a post that is tagged with a specific taxonomy.
So far I’ve got the followingf but its not working:
<?php if(has_term( 'hong-kong-2013', 'events', $post->ID ) ) : ?> <?php echo 'hong kong 2013'; ?> <?php elseif(has_term( 'london-2012', 'events', $post->ID ) ) : ?> <?php echo 'london 2012'; ?> <?php endif; ?>
Can anyone help?
Thanks
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Show content based on taxonomy’ is closed to new replies.