• 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 15 replies - 1 through 15 (of 26 total)
  • Hi Jason,

    If your theme is using the WP Nav Menu (wp_nav_menu) function to generate the cat menu, you can highlight active (current) category menu items with the class current-menu-item from your style.css file. That class is generated by WP by default.
    Hope this helps.

    Cheers!

    Thread Starter jason_donnini

    (@jason_donnini)

    This would work normally, but I forgot to mention that this theme uses superfish for the navigation…

    Is this the plugin you are using?
    Did you try contacting the author or searching in the plugin forums?
    A link to your site might also help to check whether or not superfish generates a current class automatically.

    Thread Starter jason_donnini

    (@jason_donnini)

    This plugin is embedded into the theme. I did contact the author and posted on his forum. No response as of yet. Thought I would try the WordPress community. I have been working on the site locally. I am currently moving it onto the server now…

    Ok. Although I don’t really understand why a developer would use a custom plugin for a functionality that has been default in WP for over a year now, I would still like to take a look at the theme just in case. What is the name of the theme you are using?
    The only reason I can think of using a plugin for this would be if the menu resorts to javascript for smooth dropdowns and/or effects, but even then it would not be the best solution in my opinion, since there are many scripts one could use alongside wp_nav_menu to accomplish those effects.

    Thread Starter jason_donnini

    (@jason_donnini)

    The name of the theme is viroshop… Thank you for looking into this…

    Right! It was part of your thread title, hahaha. Sorry I missed it.

    Thread Starter jason_donnini

    (@jason_donnini)

    Marventus,

    I have posted the site at: https://sub3running.com/

    the two category menu items are “News” & “Products”

    Hi again,

    Turns out your theme does generate a class for active categories in the sidebar, which means you can assign it custom styles from style.css through the #sidebar ul li a.self selector.
    For example, this code:

    #sidebar ul li a.self{
    	background-color:#e4e4e4;
    	color:#4891B6;}

    should render a very similar for selected cats to that of selected pages.

    P.S.: I couldn’t access your site through the link you posted: it led me to a splash screen where you seem to announce the launch date of the site. Letting you know just in case.

    Thread Starter jason_donnini

    (@jason_donnini)

    Well I tried this and it still did not work it ended up breaking the layout…

    I have the site defaulting to the splash page while the client finishes finalizing the content.

    The wordpress site homepage is at:

    https://sub3running.com/index.php

    You seem to have modified the theme extensively. The styles I posted above mirror the original default select state of the page nav menu.
    Regardless of this, when I look at your site, the selected category is getting the same background image as the hover state for links, so the .self class seems to be working as expected.
    Let me know if you are able to see it too.

    Thread Starter jason_donnini

    (@jason_donnini)

    I was not able to see this result. Just got the same active states when on a page and not active when in a category within the navigation…

    That is very stange. Here is a screenshot of how your site appears to me. Notice how the selected category appears to have the sane bgd image as the hovered category.
    Is that what you are trying to do?

    There is no menu item for the ‘products’ category on the home page four item sidebar menu in the link, the two item category sidebar menu works as expected.

    Now there is no top menu like in the image above, but this does have the class current-menu-item, which you can style??

    What am I missing it is working as it should as far as I can see!

    Question is which menu top or sidebar??

    HTH

    David

    Thread Starter jason_donnini

    (@jason_donnini)

    Marventus,

    With your screenshot I realized that you were addressing the sidebar. I should have been clued in by your css. I apologize…

    That is the question David. The navigation that I am having the trouble with is the top menu… Not the sidebar…

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