I’m looking to add javascript mouseover states to the navigation to have the children only appear while the parent is active. I
I believe this is the javascript:
<?php wp_nav_menu( array('container' => '', 'container_class' => '', 'menu_class' => '', 'menu_id' => 'menuhead', 'sort_column' => 'menu_order', 'theme_location' => 'primary' ) ); ?>
Any help would be great.
The site: http://svadsi.info/
This is a bit furstrating isn’t it?
Clearly no one is reading the actual question here.
The question was: where do I find the file in wordpress that I can edit the menu?
NOT tell me how to do it. So, where do you find the actual code that makes up the default menu in WordPress?
In my version the code is found in: nav-menu-template.php
You want child page links to only appear when the parent page is shown?
Have you seen the docs on the function? http://codex.wordpress.org/Function_Reference/wp_nav_menu
And a tutorial on using WP3 menus:
http://justintadlock.com/archives/2010/06/01/goodbye-headaches-hello-menus
That code you posted is PHP, not JavaScript.
Why don’t you achieve this using unobtrusive event handlers?
No need to touch WordPress’ awful code 😛
Update
Here is some code to look at it. If you’re not sure of something, google the keyword alongside with
javascript
.I’m pretty damn sure WordPress uses jQuery.
Also, knowing JavaScript without a library will assist you in debugging and general coding.
This code is similar to the jQuery.
See it on jsFiddle.
Alternatively, if you set up your HTML correctly, you can do it with just CSS.
It may be different now but when I designed my wordpress all the navigation was in the header.php file.