• Skip to primary navigation
  • Skip to content
  • Skip to primary sidebar
  • Skip to user navigation

PopWP

WordPress and Genesis Tutorials

  • Get Started
  • About
  • Archive
  • Services
  • Membership
  • My Account

Remove Responsive Menus in Genesis Sample 3.0.0+

Last Updated on September 1, 2019 Favorited: 0 times

The newer Genesis Sample doesn’t have responsive-menus.js by default and enqueue directly from the Genesis Framework.

We can remove it by deleting the following lines in child-theme/functions.php

// Registers the responsive menus.
if ( function_exists( 'genesis_register_responsive_menus' ) ) {
	genesis_register_responsive_menus( genesis_get_config( 'responsive-menus' ) );
}

Now, the file genesis-sample/config/responsive-menus.php will not work and a new menu setting will be required and you can create it by following Remove default Responsive Menus and add custom menu in Genesis Sample 3.0.0+

If you also don’t want the Superfish script to load in favor of something you would like to add, you can remove this line in genesis-sample/config/theme-supports.php

		'drop-down-menu',

Now,

To Add the Responsive menu in Genesis Sample. Create a file responsive-menus.js and(.min.js) under /js/folder. Create a folder /js/ if it is not present in child-theme.

You can simply copy both files from genesis/lib/js/menu/

and enqueue this using this

$suffix = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '' : '.min';
	wp_enqueue_script(
		'genesis-sample-responsive-menu',
		get_stylesheet_directory_uri() . "/js/responsive-menus{$suffix}.js",
		array( 'jquery' ),
		genesis_get_theme_version(),
		true
	);

under 

function genesis_sample_enqueue_scripts_styles()

so it will look like this

add_action( 'wp_enqueue_scripts', 'genesis_sample_enqueue_scripts_styles' );
/**
 * Enqueues scripts and styles.
 *
 * @since 1.0.0
 */
function genesis_sample_enqueue_scripts_styles() {

	$appearance = genesis_get_config( 'appearance' );

	wp_enqueue_style(
		genesis_get_theme_handle() . '-fonts',
		$appearance['fonts-url'],
		array(),
		genesis_get_theme_version()
	);

	wp_enqueue_style( 'dashicons' );

	if ( genesis_is_amp() ) {
		wp_enqueue_style(
			genesis_get_theme_handle() . '-amp',
			get_stylesheet_directory_uri() . '/lib/amp/amp.css',
			array( genesis_get_theme_handle() ),
			genesis_get_theme_version()
		);
	}

	$suffix = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '' : '.min';
	wp_enqueue_script(
		'genesis-sample-responsive-menu',
		get_stylesheet_directory_uri() . "/js/responsive-menus{$suffix}.js",
		array( 'jquery' ),
		genesis_get_theme_version(),
		true
	);

}

OR You can simply enqueue it by adding this at the end of child-theme/functions.php

wp_enqueue_script(
	'genesis-sample-responsive-menu',
	get_stylesheet_directory_uri() . "/js/responsive-menus.min.js",
	array( 'jquery' ),
	'1.0.0',
	true
);

To output menu toggle you can also try putting HTML

add_action('genesis_header', 'custom_menu_toggle', 10); //https://popwp.com/widget-section-in-site-header-in-genesis/

function custom_menu_toggle() {
	echo 'MENU';
}

will work only with specific code and required HTML.

Related Posts

  • Magazine style Singular Post Design in Genesis Sample
  • Post Page Blog Archive Template with Layouts in Genesis
  • Site Inner with container background in Genesis Sample
  • Change 3 columns footer widgets in 4 columns widgets in Genesis
  • Reposition Secondary menu below Primary Menu in Genesis Sample

Categories: Free Content, Genesis Tutorials Tags: Genesis Sample

Reader Interactions

Primary Sidebar

Search

WPEngine WordPress Hosting, Perfected.

Hosting You are looking for?.
Perfect solution for small business to global enterprise.

Learn more

StudioPress Genesis Theme Framework

The No.1 Theme Provider.
Creative, SEO rich Theme for all niche projects.

Learn more

Categories

  • Free Content
  • Genesis Tutorials
  • Premium Content
  • Snippets
  • What's New?
  • WordPress Tutorials

Tag Cloud

Archive Background Section blog canvas menu center logo columns conditional tags CSS CSS Grid custom Customizer custom post type Custom Post Types custom template Custom Widget effect eNews Extended Featured Image front-page Genesis Genesis Sample header right hero section Image Background js layout left menu Logo menu Navigation Menu newsletter post page related posts responsive menu search search widget Shrinking Logo site header slide in-out Stylesheet Template Utility Bar Video Background widgets WordPress

Built with Genesis Framework + WordPress by Aryan Raj

  • Contact
  • FAQ
  • Disclaimer
  • Privacy Policy
  • Copyright Policy
  • Terms of Service