Add hook to menu
-
Hello. I try to add hook to functions.php that will remove cycle link on current page, but it does not work with mega menu plugin
function nav_menu_no_link($no_link){ $gg_mk = '!<li(.*?)class="(.*?)current-menu-item(.*?)"><a(.*?)>(.*?)</a>!si'; $dd_mk = '<li$1class="\\2current-menu-item\\3">$5'; return preg_replace($gg_mk, $dd_mk, $no_link ); } add_filter('wp_nav_menu', 'nav_menu_no_link');
I also try to change current-menu-item class to mega-current-menu-item
Viewing 7 replies - 1 through 7 (of 7 total)
Viewing 7 replies - 1 through 7 (of 7 total)
- The topic ‘Add hook to menu’ is closed to new replies.