Quote:
Originally Posted by deadmoon
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()
|
It works!!
Thank you!
btw, I have a LOT of categories, would this slow down the page to have like 50 categories listed inthis code? is there a way to make it so I dont slow down the page processing?