Adding HTML and Javascript into PHP for Menu items
-
Hi, I’m new to WordPress and struggling a bit with the PHP side of things.
I want to add some javascript to the menu items I have on the site. I have prototype in HTML here
https://www.pepperstreet.co.uk/pitchandco/index.htmlMy wordpress site is at https://pitchandco.com/staging
I can’t work out how to get the javascript into the code with all the #(*/ bits in the right place.
The menu is just the default so I think I’ve found the code in the includes folder post-template.php is that correct, this means it will change the main nav but not the custom menus I have elsewhere? I have found this code:
$output .= $indent . '<li class="' . $css_class . '"><a>ID) . '">' . $link_before . apply_filters( 'the_title', $page->post_title, $page->ID ) . $link_after . '</a>';
What I need is this on something like it!!!!!
<a href="#" onmouseover="MM_swapImage('blank','','<?php bloginfo('stylesheet_directory'); ?>/images/global/logo/contact.gif',1)" onmouseout="MM_swapImgRestore()">Contact</a>
So that as I rollover a nav item the image id=”blank” changes. Please help v stuck.
Any help much appreciated.
Helen
- The topic ‘Adding HTML and Javascript into PHP for Menu items’ is closed to new replies.