Home › Forums › Support › Trying to implement a Global Navigation Header Menu & Footer for Multisite!?
- This topic has 8 replies, 6 voices, and was last updated 1 year, 7 months ago by Leo.
-
AuthorPosts
-
September 14, 2020 at 9:22 am #1442851Nathan
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!
September 14, 2020 at 9:39 am #1442879LeoStaffCustomer SupportHi 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/September 14, 2020 at 9:40 am #1442883NathanYou would think that this would be a simple feature for something like WordPress Multisite? lol Thank you LEO.
September 14, 2020 at 9:44 am #1442891LeoStaffCustomer SupportTry opening a topic in this forum branch as well:
https://wordpress.org/support/forum/wp-advanced/April 13, 2022 at 1:29 pm #2188053BenjaminI would like this functionality too. I did find this page: https://sabrinazeidan.com/wordpress-multisite-global-menu-tips-create-display-customize/#7d65adcd4d36
April 13, 2022 at 7:30 pm #2188208DerekI 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();
}April 13, 2022 at 8:26 pm #2188234Fernando Customer SupportHi 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. 🙂
August 6, 2022 at 2:57 am #2304962PierreI 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(); } }
August 8, 2022 at 2:16 pm #2307257LeoStaffCustomer SupportThanks for sharing!
-
AuthorPosts
- You must be logged in to reply to this topic.