• Resolved jason_donnini

    (@jason_donnini)


    Looking for a solution in the Viroshop theme that allows for active states for category menu items. I have been able to figure out active states for the pages within the menu but not the category menu items…

Viewing 11 replies - 16 through 26 (of 26 total)
  • Add Styles:

    #menu .sf-menu li.current-menu-item a {
        background: url("images/menu_activebar.png") no-repeat scroll center bottom transparent;
        color: #70C8F3;
    }
    #menu .sf-menu li current-menu-item a {
        color: #4891B6;
    }

    HTH

    David

    Oh! That makes more sense to me now. That’s why you were referring to the News and Products items only, haha. Sorry for the misunderstanding.
    Let me take another look at it see if there is a work-around.

    B.T.W.
    The Menu does not show in IE9 compatability IE9, it does in IE9 compatability IE8 and IE9 compatability IE7 Modes

    HTH

    David

    Jason,

    I tried your theme (version 1.2) on a test blog I have. Checkout this screenshot. The selected state seems to be working fine out-of-the-box for categories (‘Training’ is a cat).
    Did you make any changes to the menu in header.php that could have altered this behavior?
    The code that I have for the menu is as follows:

    <!--Menu-->
    <div id="menu">
    <ul id="navigation" class="nav wrap">
    <?php if (is_home()) { $highlight = "home_item"; } else {$highlight = "not_home"; } ?>
    <li class="<?php echo $highlight; ?>"><a href="<?php bloginfo('url'); ?>"><span><?php _e('Home'); ?></span></a></li>
    <?php $blogcatid = get_option( 'viro_blog_cat_id' ); wp_list_categories ("depth=-1&title_li=&include=$blogcatid"); ?>
    <?php wp_list_pages('sort_column=menu_order&depth=4&link_before=<span>&link_after=</span>&title_li=&exclude='.get_option('viro_nav_exclude')); ?>
    </ul>
    
    <!--Search Form-->
    ...
    </div> <!-- End Menu-->

    Both wp_list_categories and wp_list_pages should be inserting a current-page or current-cat class to the current item by default.

    The code shared by Digital Raindrops should work, since categories are being assigned the current-cat-item when selected.
    Thanks DR!

    Hi Marventus,
    current-menu-item

    I checked with Firebug the website is generating current-menu-item for all and current_page_item just for pages.

    there are styles for current-category, so it looks like something changed, (maybe in WP core for taxonmies) the products and news are returning:
    menu-item-type-taxonomy menu-item-object-category

    HTH

    David

    Hi DR,

    Actually, the CSS code you posted works like a charm. I added the !important attribute just in case. Check out this screenshot.

    Cheers!

    Thread Starter jason_donnini

    (@jason_donnini)

    DR and Marventus,

    I want to thank you both for working with me on this issue. The css that DR provided fixed the issue. I don’t understand why this class was not included in the theme.

    Thank you both very much…

    Thread Starter jason_donnini

    (@jason_donnini)

    DR,

    Could I get your email address. I would like to send you something just to say thanks…

    Hi Jason,
    No problem glad to help.

    my website is https://digitalraindrops.net

    Regards

    David

    Hi,

    Could you please mark this topic as resolved?

    Thanks!

Viewing 11 replies - 16 through 26 (of 26 total)
  • The topic ‘Viroshop – Active State for Categories Menu Item’ is closed to new replies.