View Single Post
Old 04-19-2007, 10:28 AM  
clickhappy
Confirmed User
 
Industry Role:
Join Date: Mar 2004
Posts: 4,027
Quote:
Originally Posted by deadmoon View Post
ok, lets say you've got 3 categories,
babe
lesbian
black

this is untested, but should work ...

PHP Code:
<?php
if (is_category('babe')) {
?>
<a href="#"><img src="yourbabeadvert.jpg" alt="" /></a>
<?php
}

if (
is_category('lesbian')) {
?>
<a href="#lesbian"><img src="yourlesbianadvert.jpg" alt="" /></a>
<?php
}


if (
is_category('black')) {
?>
<a href="#black"><img src="yourblackadvert.jpg" alt="" /></a>
<?php
}

?>
As said, http://codex.wordpress.org/Conditional_Tags is where you want to look. Hit me up over icq if you need help. Note- that will display the ad when viewing just the category page itself. To display it when viewing a post in category x, use in_category()
thank you, All done out. Nice. ill try this
clickhappy is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote