0
votes

the site I am working on is http://archibaldbutler.com/projects/williamsmurrayhamm/

My client is requesting a function I have no idea how to integrate. Highlighting a menu item (active) in white even when in a completely different site page/post/category....

Example:

Go to this page: http://archibaldbutler.com/projects/williamsmurrayhamm/designvertising/

As you can see the menu Item "Designvertising" is highlighted in white.

Now please click on the first image on the right: The plastic drink bottles called Juice burst, My client wants the "Designvertising" menu item to remain highlighted when you click through to different sections from that page.

I have not integrated menu hierarchy (child category/page), because there have been many amendments changes throughout the project.

The way I would do it if I knew php is

"If main menu item was clicked or is highlighted in white, keep highlighted in white until a different main menu item is clicked".... I hope that makes sense.

Or perhaps it is possible by integrating css into custom fields?

There are 3 pages that need this functionality:

-Latest work page -Designvertising page -Extras category

I know basic Javascript and a tiny bit of php so please be explicit.

1
Ahah, I have found a solution! It's not great though so if you have some better ideas, I would appreciate it: I added some css in a custom field : <style type="text/css"> ul.navigation div.menu-header ul#menu-main.menu li#menu-item-2434.menu-item a { color:#FFF !important; } </style> It works but requires a lot of manual editing! :)Archie Butler

1 Answers

1
votes

Make your life easier and make these sub-pages! It won't take 5 minutes and WP should add some helpful classes to the menu items, like current_page_parent etc. Then it's easily styled...

Unless I've misunderstood what you were after? Are the pages not related to the menu item?

The other way to do it is to add classes to the clicked menu item via javascript. JQuery has some useful methods for this... addClass('highlight') etc. Is this the kind of thing you need?