[Support request] Trying to implement a Global Navigation Header Menu & Footer for Multisite!?

Home Forums Support [Support request] Trying to implement a Global Navigation Header Menu & Footer for Multisite!?

Home Forums Support Trying to implement a Global Navigation Header Menu & Footer for Multisite!?

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #1442851
    Nathan

    I’ve been stumped hunting for plugins and what seems like a simple hack but it isn’t so simple and I’ve posted in several forums on Facebook and WordPress with no real solution. I’ve googled this and even shopped around on Fiverr. I’ve purchased GeneratePress Premium and I’m new to it but GeneratePress is going to be my default system for all my websites.

    Here’s my conundrum:

    I need to find a plugin that would allow a public global navigation bar that I could install at the Multisite Network Level that would be a global Navigation System for public visitors to the blog that would appear on all the sites being hosted under the same umbrella.

    As much as I love WordPress Installs, I love Multisite even more which is why I’m using individual blogs at categories.

    So since I have several niches I want to unify all the sites under one global navigation. I’m currently using Spyr Bar but it requires I update each individual blog with links and it’s a waste of time. I want to be able to make the changes once at the network level and this requires a plugin which I cannot locate, if there is a plugin for this?

    That’s why I’m reaching out to community here. I know there are plugins for internal admins but NOTHING for just a standard global navigation bar!!? Any IDEAS!?!? Thank you!

    #1442879
    Leo
    Staff
    Customer Support

    Hi there,

    I tried to Google search this and the first result was your topic haha:
    https://wordpress.org/support/topic/global-navigation-bar-for-multisite-network-help-needed/

    I’ve not heard of a solution for this unfortunately. For general questions like this, I would recommend using a forum like Stack to get more audience:
    https://wordpress.stackexchange.com/

    #1442883
    Nathan

    You would think that this would be a simple feature for something like WordPress Multisite? lol Thank you LEO.

    #1442891
    Leo
    Staff
    Customer Support

    Try opening a topic in this forum branch as well:
    https://wordpress.org/support/forum/wp-advanced/

    #2188053
    Benjamin
    #2188208
    Derek

    I found this code for putting a main site menu over the whole network. What is the theme_location for the Seconday Navigation?

    function wp_multisite_nav_menu() {

    $args = [
    ‘menu’ => ‘Main Menu’,
    ‘theme_location’ => ‘main-nav’
    ];

    switch_to_blog( 1 );

    echo wp_nav_menu( $args );

    restore_current_blog();
    }

    #2188234
    Fernando
    Customer Support

    Hi Derek,

    If you’re asking the theme_location of the secondary menu registered in GP Premium, it is secondary.

    The theme_location for the primary menu registered in GP theme is primary.

    Hope this clarifies. 🙂

    #2304962
    Pierre

    I was looking to do the same thing on my multi-site installation.

    1) Create a GP child theme on your secondary sites.

    2) Export / import GP settings (Global Colors, Typography) from your main site to your secondary sites.

    3) In functions.php child theme file : paste :

    if ( ! function_exists( 'generate_navigation_position' ) ) {
    	/**
    	 * Build the navigation.
    	 *
    	 * @since 0.1
    	 */
    	function generate_navigation_position() {
    
    		// Do switch : 2 is the identifier of my main site
    		switch_to_blog( 2 );
    
    		/**
    		 * generate_before_navigation hook.
    		 *
    		 * @since 3.0.0
    		 */
    		do_action( 'generate_before_navigation' );
    		?>
    		<nav <?php generate_do_attr( 'navigation' ); ?>>
    			<div <?php generate_do_attr( 'inside-navigation' ); ?>>
    				<?php
    				/**
    				 * generate_inside_navigation hook.
    				 *
    				 * @since 0.1
    				 *
    				 * @hooked generate_navigation_search - 10
    				 * @hooked generate_mobile_menu_search_icon - 10
    				 */
    				do_action( 'generate_inside_navigation' );
    				?>
    				<button <?php generate_do_attr( 'menu-toggle' ); ?>>
    					<?php
    					/**
    					 * generate_inside_mobile_menu hook.
    					 *
    					 * @since 0.1
    					 */
    					do_action( 'generate_inside_mobile_menu' );
    
    					generate_do_svg_icon( 'menu-bars', true );
    
    					$mobile_menu_label = apply_filters( 'generate_mobile_menu_label', __( 'Menu', 'generatepress' ) );
    
    					if ( $mobile_menu_label ) {
    						printf(
    							'<span class="mobile-menu">%s</span>',
    							$mobile_menu_label // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- HTML allowed in filter.
    						);
    					} else {
    						printf(
    							'<span class="screen-reader-text">%s</span>',
    							esc_html__( 'Menu', 'generatepress' )
    						);
    					}
    					?>
    				</button>
    				<?php
    				/**
    				 * generate_after_mobile_menu_button hook
    				 *
    				 * @since 3.0.0
    				 */
    				do_action( 'generate_after_mobile_menu_button' );
    
    				wp_nav_menu(
    					array(
    						'theme_location' => 'primary',
    						'container' => 'div',
    						'container_class' => 'main-nav',
    						'container_id' => 'primary-menu',
    						'menu_class' => '',
    						'fallback_cb' => 'generate_menu_fallback',
    						'items_wrap' => '<ul id="%1$s" class="%2$s ' . join( ' ', generate_get_element_classes( 'menu' ) ) . '">%3$s</ul>',
    					)
    				);
    
    				/**
    				 * generate_after_primary_menu hook.
    				 *
    				 * @since 2.3
    				 */
    				do_action( 'generate_after_primary_menu' );
    				?>
    			</div>
    		</nav>
    		<?php
    		/**
    		 * generate_after_navigation hook.
    		 *
    		 * @since 3.0.0
    		 */
    		do_action( 'generate_after_navigation' );
    
    		// Undo switch
    		restore_current_blog();
    
    	}
    }
    #2307257
    Leo
    Staff
    Customer Support

    Thanks for sharing!

Viewing 9 posts - 1 through 9 (of 9 total)
  • You must be logged in to reply to this topic.