Conditional Image based menu help
-
I’ve got a menu that shows the page/category image that is selected, along w/ the home page.
My code that I’d like some tweaking done to is:
<?php if(is_home()){ ?><a class="blog-active" href="/"><span>blog</span></a><?php } else { ?><a class="blog" href="/"><span>blog</span></a><?php } ?> <?php if (is_category('8') && !is_single()){ ?><a class="photos-active" href="/category/gallery"><span>photos</span></a><?php } else { ?><a class="photos" href="/category/gallery"><span>photos</span></a><?php } ?>
Basically if it’s home, or a single post that is not in category 8, show the blog-active. If it’s category 8 or a post that’s within category 8, show the photos-active.
What am I missing?
Thanks!
- The topic ‘Conditional Image based menu help’ is closed to new replies.