Snippets: Display Cart Link Shortcode in Mobile Menu Toggle

This snippet shows how you could easily display the cart_link shortcode in your mobile menu toggle area.

// Insert cart link shortcode to fixed mobile menu toggle
// Note: This could also be done via Theme Panel > Custom Actions without any code.
add_action( 'wpex_hook_mobile_menu_toggle_bottom', function() {
    echo do_shortcode( '[cart_link]' );
} );


Snippet Type: PHP

All PHP snippets should be added via a child theme's functions.php file or via the Code Snippets Plugin (or alternative plugin)