WordPress.org

Ready to get started?Download WordPress

Forums

display custom menu on each site (3 posts)

  1. Raisis
    Member
    Posted 3 years ago #

    Hello,

    I created a custom menu called 'mainmenu' and insert this code to my header.php:

    <?php wp_nav_menu( array( 'menu' => 'mainmenu' )); ?>

    This menu appears on my main site and all sites and articles of my main blog. But when I switch to another blog of my multisite network, the menu disappears. Is it possible to display one custom menu on all multisite sites without creating the menu again and again for each blog?

  2. just before the nav bar code put
    <?php switch_to_blog(1); ?>
    right after the navbar code put
    <?php restore_current_blog(); ?>
    then it will always show the pages from Blog #1.

  3. Raisis
    Member
    Posted 3 years ago #

    You are my hero :)

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.