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.

Was This Tutorial Helpful?

Free

$0

Access only to all free tutorials per month.



Monthly

$75

Access to 10 premium tutorials per month.


Tutorial Request


Includes code guarantee and coding support.

Yearly

$500

Access to 15 premium tutorials per month.


Monthly Tutorial Request


Includes code guarantee and priority coding support.