has_tag WordPress plugin

Update: Function has been added in WordPress 2.6, so use this plugin if you’re stuck on 2.3-2.5.

The Has Tag WordPress plugin lets you call has_tag($tag) in your post loop to check if a post has a given tag, e.g. has_tag(‘games’). I needed it to customize advertising to specific pages, so I can show gaming adverts for the ‘games’ tag or shopping adverts for the ‘shopping’ tag. Note: Only works with WordPress built-in tags that were added in version 2.3. So works on Versions 2.3-2.5.

Usage in single.php or wherever your post loop is in your theme:

<?php if(has_tag(‘games’)) { ?>
…games advertising stuff….
<? } ?>

Download:

Version 0.1


Online Colleges - search for 1000+ online degrees, online colleges & online universities

Pages

About

Whatever catches our internet-shortened attention spans will be propped up here as a decoy to lure your boredom out in the open, where we’ll silently glide out of the shadows and slit it’s tedious throat. Because we care.

Join the forums to discuss world domination, or peruse the Wiki for arcane knowledge.

Java, WordPress, PHP, Javascript, Python, Apache, Scala, WTF, I’m Totally Lost! Let us help. Get your very own ninja software developer and consultant and we’ll make your problems…disappear.

Twitter

Posting tweet...

Tags

advert art beautiful-south-africans beautiful-women beauty bizarre book business design environment firefox funny funny-video games google health hotties Humanity java life mac marketing mobile movies music nature philosophy photography photos programming psychology rant review science science-fiction singularity software software-development south-africa technology thoughts tips trailer trailers video