Jump to content
Sign in to follow this  
jgw52

highlight current page

Recommended Posts

jgw52

Greetings I lifted this css from a response to another user and it worked fine but... I still do not seem to have control over the current page menu highlight. (I'd like to reverse text and background color when on the current page.) Thanks #primary-nav {background: #017dc3;} #primary-nav li a {background: #017dc3; color: #ffffff:} #primary-nav #nav_row {border-bottom: 0px solid #151B8D;} #primary-nav .main-nav li a:hover{ background: #455660; color:#ffffff; } body .main-nav li.current-page-ancestor a, .main-nav li.current_page_item a, .main-nav li.current-page-ancestor ul a, .main-nav li.current_page_item ul a{ background-color: #ffffff; color: #017dc3; } #primary-nav ul.sf-menu a, .sf-menu a:visited { color:#fff; } #primary-nav ul.sf-menu li a { padding: 7px 15px; } #primary-nav li a{ font-size: 1em; text-transform: lowercase; color:#ffffff; }

Share this post


Link to post
Share on other sites
jgw52

Sorry Kate, its a local install for the moment (which is a very good thing, I'm telling you, because I have a ways to go.) Does it help to say I'm trying to style a custom primary menu, no drop-downs? Is there anything else I can tell you that can help you track down my problem? Ta for your reply.

Share this post


Link to post
Share on other sites
bryan-hadaway

Are you using Custom Code > Custom CSS or base.css? Anything else is not recommended. You may have to be more specific with the CSS; for example: `body #primary-nav {background: #017dc3;}` Thanks, Bryan

Share this post


Link to post
Share on other sites
jgw52

Hi Bryan Yes, I'm using custom code and the PlatformBase child theme. My colors are working except the current page bit. I've tried "body" as the start for the bits of CSS that I think might be responsible for the current page menu itme styling but I am definitely missing something. I thought this bit of css looked promising but nothing changes... ` body .main-nav li.current-page-ancestor a, .main-nav li.current_page_item a, .main-nav li.current-page-ancestor ul a, .main-nav li.current_page_item ul a{ background-color: #ffffff; color: #017dc3; ` Thanks for your help.

Share this post


Link to post
Share on other sites
bryan-hadaway

Let's get a link please. Thanks, Bryan

Share this post


Link to post
Share on other sites
jgw52

Thanks Bryan The sites's not up yet. Its just a local install while I figure out what I'm doing. Perhaps I can cut/paste some code for you or something? Thanks again

Share this post


Link to post
Share on other sites
bryan-hadaway

See if you can take control with this selector: `.current-menu-item` adding whatever styles to it you want. Thanks, Bryan

Share this post


Link to post
Share on other sites
jgw52

Hi Bryan No, I didn't get control with this selector but I'm chasing down another option (via plugins). Should we retire this thread? I'll pipe up again if a solution continues to elude me. Thanks again for your help

Share this post


Link to post
Share on other sites
Kate

Hey John - That's up to you. One more thing you may want to try: use the "!important" declaration... May or may not work but it's worth a shot ;)

Share this post


Link to post
Share on other sites
jgw52

Well Kate and Bryan, I've cobbled together a solution. I turned off the main nav via css (display:none)as per the Pagelines video and used the Wordpress guide to make another menu. I very gingerly inserted a bit of php into the child theme header file and now all I have to do is play with dynamic highlighting. Wish me luck. Thanks again and something tells me I'll be back.

Share this post


Link to post
Share on other sites
bryan-hadaway

Thanks for sharing and good luck, gave ya your first karma point. Thanks, Bryan

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  

×