Skip to content

Snippet: Add Content Above Mobile Menu

Important: You can also do this via the Theme Actions panel.

This snippet shows you how you can insert custom content to the top of the mobile menu using theme hooks.

/**
 * Add Content Above the Mobile Menu.
 *
 * @link https://totalwptheme.com/docs/snippets/add-content-above-mobile-menu/
 */
add_action( 'wpex_hook_mobile_menu_top', function() {
	echo '<div>Before mobile menu</div>';
} );
All PHP snippets should be added via child theme's functions.php file or via a plugin. We recommend Code Snippets (100% Free) or WPCode (sponsored)
Back To Top