We help IT Professionals succeed at work.

Jquery load method working on wordpress home page, not on other pages/posts

St_Aug_Beach_Bum
St_Aug_Beach_Bum asked
on
I want to load my main menu using the jquery load method.

I'm using this code in my wordpress theme's header.php file:

------------------

<div id="UBmenu"></div>
   <script type="text/javascript">
$(function() {
   $( "#UBmenu" ).load( "http://www.(mySite).com/menu/menu.html" );
});
    </script>

----------------
 

It works... but only on the home page. It doesn't load on any of the other pages and posts. The code is in the source code, but for some reason it's not showing the menu.

I'm stuck - can you help troubleshoot this?

Here's my home page:

http://shoutkey.com/voltage 

just click on any of the other pages/posts and you'll see it's not loading on those.

Thanks for any assistance,

Chris
Comment
Watch Question

Author

Commented:
I'm not even positive if the file isn't loading or just not displaying.... I think it's not loading.

I'm looking at firefox/firebug... and I think that's what I'm seeing... but I'm not familiar enough with firebug to know for sure.

Author

Commented:
hmm, ok, found the problem.... apparently a plugin that doesn't load on the home page is the source of the problem. Now... how do I fix that and still use the plugin...?
F P
Top Expert 2015

Commented:
I don't see the issue. Where is it on the page?
Top Expert 2015
Commented:
I think this might be due to you not using the require of wp-load.php in the php file you're pulling from?

Author

Commented:
I got this worked out, thank you for chipping in here :)