{"id":267672,"date":"2020-10-27T10:54:07","date_gmt":"2020-10-27T10:54:07","guid":{"rendered":"https:\/\/www.megamenu.com\/?post_type=ht_kb&#038;p=267672"},"modified":"2020-10-27T11:04:56","modified_gmt":"2020-10-27T11:04:56","slug":"social-now-mythemeshop","status":"publish","type":"ht_kb","link":"https:\/\/www.megamenu.com\/documentation\/social-now-mythemeshop\/","title":{"rendered":"Social Now (MyThemeShop)"},"content":{"rendered":"<h3>Fix Mobile Menu<\/h3>\n<p>If you have Max Mega Menu enabled for the mobile location, you&#8217;ll find clicking on parent item links prematurely closes the mobile slideout panel. To fix this, add the following to your <a href=\"https:\/\/developer.wordpress.org\/themes\/advanced-topics\/child-themes\/\">child themes<\/a> functions.php file:<\/p>\n<pre class=\"lang:default decode:true \">\/** Add 'toggle-caret' class to all menu item links to prevent the theme from closing the mobile menu whenever a link is clicked **\/\r\nfunction megamenu_prevent_premature_mobile_menu_close( $atts, $item, $args ) {\r\n\tif ( $args-&gt;theme_location == 'mobile' ) {\r\n\t\t$atts['class'] = $atts['class'] . \" toggle-caret\";\r\n\t}\r\n\r\n\treturn $atts;\r\n}\r\nadd_filter( 'megamenu_nav_menu_link_attributes', 'megamenu_prevent_premature_mobile_menu_close', 10, 3 );<\/pre>\n<p>Next install the TC Custom JavaScript plugin and add the following to <em>Appearance &gt; Custom JavaScript<\/em>:<\/p>\n<pre class=\"lang:default decode:true \">jQuery(document).ready(function( $ ) {\r\n    jQuery(\".toggle-mobile-menu\").on(\"click\", function() {\r\n      setTimeout(function(){  \r\n          \/** Reinitialise Max Mega Menu to fix click events **\/\r\n          jQuery('#mega-menu-mobile span.mega-indicator').removeAttr('data-has-click-event');\r\n          jQuery('#mega-menu-mobile').unbind().removeData().maxmegamenu();\r\n      }, 250);\r\n    });\r\n});<\/pre>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Fix Mobile Menu If you have Max Mega Menu enabled for the mobile location, you&#8217;ll find clicking on parent item links prematurely closes the mobile slideout panel. To fix this, add the following to your child themes functions.php file: \/** Add &#8216;toggle-caret&#8217; class to all menu item links to prevent&#8230;<\/p>\n","protected":false},"author":1,"comment_status":"open","ping_status":"closed","template":"","format":"standard","meta":{"_uag_custom_page_level_css":"","footnotes":""},"ht-kb-category":[15],"ht-kb-tag":[],"class_list":["post-267672","ht_kb","type-ht_kb","status-publish","format-standard","hentry","ht_kb_category-theme-integration"],"uagb_featured_image_src":[],"uagb_author_info":{"display_name":"Tom Hemsley","author_link":"https:\/\/www.megamenu.com\/author\/megamenu\/"},"uagb_comment_info":0,"uagb_excerpt":"Fix Mobile Menu If you have Max Mega Menu enabled for the mobile location, you&#8217;ll find clicking on parent item links prematurely closes the mobile slideout panel. To fix this, add the following to your child themes functions.php file: \/** Add 'toggle-caret' class to all menu item links to prevent...","_links":{"self":[{"href":"https:\/\/www.megamenu.com\/wp-json\/wp\/v2\/ht-kb\/267672","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.megamenu.com\/wp-json\/wp\/v2\/ht-kb"}],"about":[{"href":"https:\/\/www.megamenu.com\/wp-json\/wp\/v2\/types\/ht_kb"}],"author":[{"embeddable":true,"href":"https:\/\/www.megamenu.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.megamenu.com\/wp-json\/wp\/v2\/comments?post=267672"}],"version-history":[{"count":4,"href":"https:\/\/www.megamenu.com\/wp-json\/wp\/v2\/ht-kb\/267672\/revisions"}],"predecessor-version":[{"id":267674,"href":"https:\/\/www.megamenu.com\/wp-json\/wp\/v2\/ht-kb\/267672\/revisions\/267674"}],"wp:attachment":[{"href":"https:\/\/www.megamenu.com\/wp-json\/wp\/v2\/media?parent=267672"}],"wp:term":[{"taxonomy":"ht_kb_category","embeddable":true,"href":"https:\/\/www.megamenu.com\/wp-json\/wp\/v2\/ht-kb-category?post=267672"},{"taxonomy":"ht_kb_tag","embeddable":true,"href":"https:\/\/www.megamenu.com\/wp-json\/wp\/v2\/ht-kb-tag?post=267672"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}