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.