-
-
Save BryanBarrera/eb3e65a3d7a998f9181ddf0dcd8b3086 to your computer and use it in GitHub Desktop.
Add content to the vertical menu in the Beaver Builder Theme (before)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Add a Beaver Builder Template to the bottom of the Beaver Builder Theme vertical menu | |
add_filter( 'wp_nav_menu_items', 'your_custom_menu_item', 10, 2 ); | |
function your_custom_menu_item ( $items, $args ) { | |
// if the menu is in fact our header menu | |
if ($args->theme_location == 'header') { | |
// get the content of our Beaver Builder Template | |
$bb_content = do_shortcode('[fl_builder_insert_layout slug="vertical-menu-content-bottom"]'); | |
// append the content of our Beaver Builder Template to the end of our menu | |
$items = $bb_content . $items; | |
} | |
// return our menu + Beaver Builder content ready for output | |
return $items; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment