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

WP SITES

2662

Original Genesis Tutorials & 5000+ Guaranteed Code

Snippets

  • Support
  • Newsletter
  • Videos
  • Log in

Premium Member? - Request custom code

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

PHP Code

template_include

get_body_class

if else

array

class_exists

foreach

sprintf

add_action

printf

variable

Advertise · WPEngine · Genesis · Log in

  • How Premium Membership Works
  • Sign Up
  • Support
  • Subscription Details/Invoice
  • Tagged Tutorials
  • Access-Download Problems