• Skip to main content
  • Skip to primary sidebar
  • Business
  • WordPress
  • Security
  • Marketing
  • Publicity
  • Computing
  • Resources
  • Whatevs

Purely Wordpress

Just The Tech, News, and Info We Deem To Post

  • Home
  • About
  • Contact
  • Contribute
You are here: Home / Code Snippets / Add Navigation Bar Widgets to Genesis Child Themes

Add Navigation Bar Widgets to Genesis Child Themes

Genesis Theme Framework Code Snippets

How to add Primary and Secondary Navigation Widgets to Genesis Navigation Bars.

Add the following code to your WordPress theme’s function.php file, or a functionality plugin to add Primary and Secondary Navigation Widgets to Genesis.

/* Custom Nav right hand side extra */
add_filter( 'genesis_nav_items', 'social_follow_icons', 10, 3 );
add_filter( 'wp_nav_menu_items', 'social_follow_icons', 10, 3 );
function social_follow_icons($menu, $args) {
 $args = (array)$args;
 if ( 'primary' !== $args['theme_location'] )
 return $menu;
 ob_start();
 dynamic_sidebar('Social Icons');
 $social = ob_get_clean();
 return $social . $menu;
}
/* Custom Nav right hand side extra */
add_filter( 'genesis_nav_items', 'google_search', 10, 2);
add_filter( 'wp_nav_menu_items', 'google_search', 10, 2);
function google_search($menu, $args) {
    $args = (array)$args;
    if ( 'secondary' !== $args['theme_location'] )
    return $menu;
    ob_start();
    dynamic_sidebar('Google Search');
    $social = ob_get_clean();
    return $social . $menu;
}
genesis_register_sidebar( array(
	'id'		=> 'google-search',
	'name'		=> __( 'Google Search', 'marketing' ),
	'description'	=> __( 'Primary Navigation Search Box.', 'marketing' ),
) );
genesis_register_sidebar( array(
	'id'		=> 'Social-Icons',
	'name'		=> __( 'Social Icons', 'marketing' ),
	'description'	=> __( 'Secondary Navigation Social Icons.', 'marketing' ),
) );

by Jack Alltrade on October 16, 2020

Filed Under: Code Snippets Tagged With: Code, Genesis Child Theme, Genesis Framework, Layout, Navigation Menus

Reader Interactions

Share Your Two Cents Cancel reply

Your email address will not be published. Required fields are marked *

Primary Sidebar

Categories

  • Code Snippets
  • Development
  • File Management
  • Genesis Framework
  • Hosting
  • Legacy
  • Plugins
  • SEO
  • Tech Terms
  • Themes
  • User Experience
  • User Interface
  • WordPress Core
  • WordPress Functionality

Warning! Use at your own risk!

As always, use at your own risk and remember to backup your site prior to inserting new code.

© Copyright Jack Alltrade & Associates 2025 · Purely Supplemental™ is a trademark of Jack Alltrade & Associates