• Xavvi

    (@skinny-latte)


    I am using dynamic menu highlighting as suggested in the wordpress codex.

    It is working on almost all of my pages (categories and post pages within those categories). However, I have a portfolio section with multiple sub categories and I cannot get the single posts within these subcategories to highlight the main portfolio link.

    Here is what I mean. I have a top level menu link of ‘portfolio’. Within that there are subcats of web design, graphic design etc etc

    when I am in a post of one of the subcategories or the portfolio link itself I want the portfolio link to be highlighted. This is the code I am using:

    <li<?php
                   if (is_page('portfolio') || is_category(array('5','6','9','16'))
                    {
                    echo " id=\"current\"";
                    }?>>
                    <a href="<?php echo get_settings('home'); ?>/portfolio/">portfolio</a>
            </li>

    Number 5 is the portfolio category, 6, 9 and 16 are the subcategories. This is giving me an error. I can sort of see why….but I don’t know how to correct it. Would I need to use an elseif statement within this particular list item?

    Any help would be hugely appreciated!

  • The topic ‘Dynamic menu highlighting of multiple subcategories’ is closed to new replies.