WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Conditional Image based menu help (1 post)

  1. shaneholden
    Member
    Posted 5 years ago #

    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!

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.