Set a color for an "active" or "current" link in a sidebar widget

I am using Twenty Thirteen theme and build a website.

know i want a active or current link on my sidebar widget.

URL: http://qespro.com/qespro.com/commercial-retail/
If you see above URL i am on Commercial & Retail page and on left sidebar
there is also a link “Commercial & Retail” How can i make that link active or current link in side bar widget.

Does nay body have a solution for that ?

Looking for great help.

It looks like you’re not using WordPress wp_nav_menu() to build out your navigation so it won’t work without using JavaScript. Normally, you’ll add a custom menu to your functions.php with register_nav_menus:

register_nav_menus([
    'my-sidebar'    => 'My Sidebar'
]);

Then you add in the links through the WordPress dashboard (like you do with your main menu). Then in your themes file you just add:

<?php wp_nav_menu([
    'menu'  => 'my-sidebar'
]); ?>

Since you’re using Twenty Thirteen the links should become highlighted automatically. If you need to change the appearance you can add something like the following in style.css:

.current-menu-item{ /* your styles here */ }

To target more specific styles, you can check out: http://codex.wordpress.org/Function_Reference/wp_nav_menu#Menu_Item_CSS_Classes

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.