Tag Info

Hot answers tagged


Solution #1 (not ideal, but it works): // Live Chat Utility Link add_filter( 'wp_nav_menu_items', 'live_chat_utility_link', 10, 2 ); function live_chat_utility_link ( $items, $args ) { if ( $args->theme_location == 'utility' ) { $items .= '<li><a href="javascript:void(0);" onclick="olark(\'api.box.expand\')" class="livechat">Live ...


Good that it works. If it's for a client or if you just want cleaner code, you can do it as @Tom J Nowell suggested. Add a custom menu item, link it to nowhere or anywhere. Find out the menu item ID (every item has one), and then target that ID with jQuery. $("#menu-item-num").on("click", function(e){ e.preventDefault(); // olark code here ...

Only top voted, non community-wiki answers of a minimum length are eligible