I am trying to echo main theme's menu items across the headers of other sites in a WP multi-site environment and was wondering what is the proper way of doing this. I tried iframe which works but there is a delay in displaying the header. So, the body gets loaded and couple of seconds later the header populates. Here is the iframe code I have:

<iframe class="header-iframe" src="http://example.com/common-header/" frameborder="0" scrolling="no" width="100%" height="233px;" ></iframe>

(please excuse my way of questioning)
I notice that in one of the site's header, to echo something, it show something like this:

<?php bloginfo('siteurl')

now, if I want to display from the main theme, what should be my PHP statement?

1 Answer 1


Sorry this should be a comment --> you should be able to use a switch to blog http://codex.wordpress.org/Function_Reference/switch_to_blog This will allow you to grab the main blog ID, from there you can use a WP list pages or a http://codex.wordpress.org/Function_Reference/wp_nav_menu to display the menu of your main site on the other blogs within the network

  • Thanks very much! this was very helpful. Trying to see how I can implement it on my site.
    – Dave_O
    Commented Jan 2, 2015 at 22:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.