{"id":248378,"date":"2020-06-13T12:41:50","date_gmt":"2020-06-13T11:41:50","guid":{"rendered":"https:\/\/www.megamenu.com\/documentation\/how-to-disable-the-sticky-menu-on-a-specific-page-copy\/"},"modified":"2020-06-13T12:55:04","modified_gmt":"2020-06-13T11:55:04","slug":"use-nav-element","status":"publish","type":"ht_kb","link":"https:\/\/www.megamenu.com\/documentation\/use-nav-element\/","title":{"rendered":"Use &#8216;nav&#8217; element as the menu container"},"content":{"rendered":"<p>Add the following code to your themes functions.php page to change the &lt;div&gt; element to a &lt;nav&gt; element for your menus.<\/p>\n<pre class=\"lang:default decode:true \">function megamenu_use_nav_container( $defaults, $menu_id, $current_theme_location ) {\r\n\t$defaults['container'] = 'nav';\r\n\treturn $defaults;\r\n}\r\nadd_filter( \"megamenu_nav_menu_args\", \"megamenu_use_nav_container\", 10, 3 );<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Add the following code to your themes functions.php page to change the &lt;div&gt; element to a &lt;nav&gt; element for your menus. function megamenu_use_nav_container( $defaults, $menu_id, $current_theme_location ) { $defaults[&#8216;container&#8217;] = &#8216;nav&#8217;; return $defaults; } add_filter( &#8220;megamenu_nav_menu_args&#8221;, &#8220;megamenu_use_nav_container&#8221;, 10, 3 );<\/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":[14],"ht-kb-tag":[],"class_list":["post-248378","ht_kb","type-ht_kb","status-publish","format-standard","hentry","ht_kb_category-faqs"],"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":"Add the following code to your themes functions.php page to change the &lt;div&gt; element to a &lt;nav&gt; element for your menus. function megamenu_use_nav_container( $defaults, $menu_id, $current_theme_location ) { $defaults['container'] = 'nav'; return $defaults; } add_filter( \"megamenu_nav_menu_args\", \"megamenu_use_nav_container\", 10, 3 );","_links":{"self":[{"href":"https:\/\/www.megamenu.com\/wp-json\/wp\/v2\/ht-kb\/248378","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=248378"}],"version-history":[{"count":2,"href":"https:\/\/www.megamenu.com\/wp-json\/wp\/v2\/ht-kb\/248378\/revisions"}],"predecessor-version":[{"id":248380,"href":"https:\/\/www.megamenu.com\/wp-json\/wp\/v2\/ht-kb\/248378\/revisions\/248380"}],"wp:attachment":[{"href":"https:\/\/www.megamenu.com\/wp-json\/wp\/v2\/media?parent=248378"}],"wp:term":[{"taxonomy":"ht_kb_category","embeddable":true,"href":"https:\/\/www.megamenu.com\/wp-json\/wp\/v2\/ht-kb-category?post=248378"},{"taxonomy":"ht_kb_tag","embeddable":true,"href":"https:\/\/www.megamenu.com\/wp-json\/wp\/v2\/ht-kb-tag?post=248378"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}