skip to Main Content

Insert a Button Next to the Mobile Menu Toggle

This can also be done via Theme Panel > Custom Actions or if you are using one of the new "Flex" header styles you can do this via the Customizer under Header > General > Aside Content.

This sample snippet show you how to insert a button (it can be anything though) inside the Header Menu Mobile Toggle area.

/**
 * Inserts a button next to the mobile menu toggle.
 *
 * @link https://total.wpexplorer.com/docs/snippets/header-menu-mobile-toggle-button/
 */
add_action( 'wpex_hook_mobile_menu_toggle_bottom', function() {
	echo '<a href="#" class="theme-button">Buy Now</a>';
} );
All PHP snippets should be added via child theme's functions.php file or via the Code Snippets Plugin (or alternative plugin)
Back To Top