Answer the question
In order to leave comments, you need to log in
How to access one item from the menu?
There is a code that should add data-toggle to only one item from the menu,
add_filter('wp_nav_menu_items', 'add_data_target_to_wp_nav_menu_items');
function add_data_target_to_wp_nav_menu_items($items) {
return str_replace('<a ', '<a data-toggle="modal"', $items);
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question