• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

WP SITES

2762

Original Genesis Tutorials & 6000+ Guaranteed Code

Snippets

  • Premium Access
  • Log in

Sub Menu Not Working In Genesis Child Themes

A member asked this question :

no matter what I do, I cannot get the submenu to appear

Answer : The reason for this might be, some Genesis child themes include the following PHP code in functions.php which removes the sub menu from displaying below parent menu items.

add_filter( 'wp_nav_menu_args', 'essence_secondary_menu_args' );
/**
 * Reduces the secondary navigation menu to one level depth.
 */
function essence_secondary_menu_args( $args ) {

	if ( 'secondary' === $args['theme_location'] ) {
		$args['depth'] = 1;
	}

	return $args;

}

The above code targets the secondary menu. Swap out secondary to match your menu’s theme location if you need to target other menus.

Located around line 176 in the Infinity Pro themes functions file.

Nav Menu

Reader Interactions

Leave a Reply Cancel reply

You must be logged in to post a comment.

Primary Sidebar

Code written by Brad Dalton specialist for WooCommerce & WordPress theme customization. Read More…

Advertise · WPEngine · Genesis · Log in

  • Access Problems
  • Account Details
  • Consulting