Convert a custom bootsrap based menu to wordpress nav walker

The easier way is to use Wp Bootstrap Navwalker script here: https://github.com/wp-bootstrap/wp-bootstrap-navwalker. It’s already built to handle all the Bootstrap to WordPress dynamic styling. All you would need to do is include file in your functions.php file. require_once get_template_directory() . ‘/wp-bootstrap-navwalker.php’; And add the php code to the Bs Navbar links area of the code. … Read more

add dynamic ID for wp_nav_menu after and before

Try this: function custom_walker_nav_menu_start_el($item_output, $item, $depth, $args){ $output=”<div class=”buttons-“.$item->ID.'” title=”some_title”>’; $output .= $item_output; $output .= ‘</div>’; return $output; } add_filter( ‘walker_nav_menu_start_el’, ‘custom_walker_nav_menu_start_el’ , 10, 4 ); This uses walker_nav_menu_start_el filter to add custom content before and after the link item. ID is appended to buttons-. If you need this customization for only specific menu then … Read more