Wordpress Themes - WP Forum at BFA

Wordpress Themes - WP Forum at BFA (http://forum.bytesforall.com/index.php)
-   Page & Category Menu Bars (http://forum.bytesforall.com/forumdisplay.php?f=10)
-   -   [SOLVED] How to highlight menu list items (http://forum.bytesforall.com/showthread.php?t=22968)

RHCdG Dec 20, 2014 11:28 AM

[SOLVED] How to highlight menu list items
 
Hello all,

I managed to find how to highlight menu list items on hover, (under ATO>Style Widgets>Widget List Items>Link Text Hover Color) but I would like to highlight the menu list item that the user clicks so that the active list item remains highlighted in the menu while the user is on the respective page. Is there a way to do that, please?

Many thanks,
Rutger

Jam Dec 20, 2014 04:55 PM

I dont use ATA anymore, but you need to look for or add 'current-page' attribute. I will try and find an example code, brb.

These are two examples of code from Themeframe built sites (same developer, often same code), that will give the current page (or list item) specific attributes. Use a code inspector to find what you have or try adding the following (with your CSS) to see the results. Play time :)

Code:

.widget ul li.current_page_item {
}

Actually, further digging, on another site its this code :)
Code:

.widget ul li a:hover, .widget ul li.current_page_item a, .widget ul li.current-cat a
Its fun to play and learn, good luck.

RHCdG Dec 21, 2014 12:28 AM

Thanks, Jam! I appreciate, and agree with the fun of learning and playing. :)
I am not clear, however, on where I would put the second snippet you gave me.
Also, does it state that the highlighting should be e.g. red?

juggledad Dec 21, 2014 09:51 AM

Jam gave you the css selector, you need to add the css rule you want and then put it all in the CSS inserts option

RHCdG Dec 22, 2014 04:39 AM

Thanks JD,

This is now in ATO>CSS Inserts:

Code:

.widget ul li a:hover {
font-color: #E51616;
}

.widget ul li.current_page_item a {
font-color: #E51616;
}

.widget ul li.current-cat a {
font-color: #E51616;
}

... but it does not work

lmilesw Dec 22, 2014 04:56 AM

font-color is not a valid CSS rule. It should be just color

RHCdG Dec 22, 2014 05:00 AM

Thanks, Miles, but still no result. Would you guys care to take a look, perhaps?

lmilesw Dec 22, 2014 05:12 AM

I just used a code inspector (Firebug) and saw that the selector is current-menu-item not current_page_item so the rule would be
HTML Code:

.current-menu-item a {
    color: red !important;
}

I left out the other part of what you had as it is not needed and added !important as there is apparently some other code that this needs to override.

RHCdG Dec 22, 2014 05:57 AM

That actually works, Miles :)
Thanks, all!


All times are GMT -6. The time now is 07:41 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.