{"id":401,"date":"2012-07-12T13:39:30","date_gmt":"2012-07-12T13:39:30","guid":{"rendered":"https:\/\/www.frozenlogistic.com\/?p=401"},"modified":"2013-04-15T06:07:23","modified_gmt":"2013-04-15T06:07:23","slug":"navigation-settings-2","status":"publish","type":"post","link":"https:\/\/www.frozenlogistic.com\/?p=401","title":{"rendered":"Navigation settings"},"content":{"rendered":"<p>GavernWP gives a possibility of advanced menu managing on a website. There is a list of menus available in a theme in a configuration file &#8211; <strong>menus.json<\/strong>. These menus are displayed in a <strong>Navigation<\/strong> tab:<\/p>\n<p><a href=\"https:\/\/www.frozenlogistic.com\/wp-content\/uploads\/2012\/07\/meetgavernwp_nav.jpg.jpg\"><img fetchpriority=\"high\" decoding=\"async\" class=\"aligncenter size-full wp-image-891\" alt=\"meetgavernwp_nav.jpg\" src=\"https:\/\/www.frozenlogistic.com\/wp-content\/uploads\/2012\/07\/meetgavernwp_nav.jpg.jpg\" width=\"548\" height=\"539\" \/><\/a><\/p>\n<p>There are a few options available for each menu available on a website. Website&#8217;s main menu has more options than a menu placed e.g. in a page&#8217;s footer.<\/p>\n<p>The difference is that a main menu has additional options connected with animation:<\/p>\n<p><a href=\"https:\/\/www.frozenlogistic.com\/wp-content\/uploads\/2012\/07\/meetgavernwp_menu.jpg.jpg\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-892\" alt=\"meetgavernwp_menu.jpg\" src=\"https:\/\/www.frozenlogistic.com\/wp-content\/uploads\/2012\/07\/meetgavernwp_menu.jpg.jpg\" width=\"537\" height=\"99\" \/><\/a><\/p>\n<p>These options allow to specify the type and speed of animation of a submenu.<\/p>\n<p>Additionally, all menu types have the two options:<\/p>\n<ul>\n<li>an option specifying whether a menu given was switched on &#8211; a menu given can be switched on only on a particular subpages thanks to a <strong>Conditional rule<\/strong> option &#8211; then, you have to insert a rule from\u00a0 <a href=\"http:\/\/codex.wordpress.org\/Conditional_Tags\">Conditional Tags<\/a> and logic operators of a PHP language in\u00a0 a Conditional rule field, e.g. a rule displaying a menu on the homepage and in a category called \u00abMeet GavernWP\u00bb will have the following form:\u00a0 [code]is_homepage() || is_category(&#8216;Meet GavernWP&#8217;)[\/code]<\/li>\n<li>an option specifying menu depth i.e. a maximal nesting level for all menu positions displayed. If e.g. you want to skip the second menu level and display menu positions which are on the first menu level, you have to set this option to <strong>1<\/strong>. Of course <strong>All levels<\/strong> value will cause displaying all menu postions available for a menu given.<\/li>\n<\/ul>\n<p>You have to remember that adding a menu, except adding an appropriate entry in an configuration file <strong>menus.json<\/strong>, also requires creating appropriate code in a theme.<\/p>\n<p>This code uses a standard <a href=\"http:\/\/codex.wordpress.org\/Function_Reference\/wp_nav_menu\">wp_nav_menu<\/a> function but you have to remember about three crucial things:<\/p>\n<ul>\n<li>code of <strong>wp_nav_menu<\/strong> function has to be placed inside IF condition in a form:<strong><\/strong> [code]if(gk_show_menu(&#8216;MENU_NAME&#8217;)) {[\/code] where <strong>MENU_NAME<\/strong> is a menu name, e.g. <strong>mainmenu<\/strong><strong><\/strong>. Thanks to it, there will be a functionality which allows to display a menu only on subpages chosen.<\/li>\n<li>in the case of main menu, it is very useful to create a duplicate in a mobile version so as while displaying a website on mobile devices, a menu will be adjusted to mobile devices.<\/li>\n<li>in the case of a main menu, you have to use a special class derived from <strong>Walker<\/strong>: <strong>GKMenuWalker<\/strong> class; however, for a mobile menu, you have to use\u00a0<strong>GKMenuWalkerMobile<\/strong> class. Thanks to it, appropriate menu structure will be generated.<\/li>\n<\/ul>\n<p>CSS code connected with a menu is in <strong>css\/wp.css<\/strong> and <strong>css\/mobile.css<\/strong> files.<\/p>\n<p>Scripts creating main menu animations are in <strong>js\/gk.menu.js<\/strong> file.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>GavernWP gives a possibility of advanced menu managing on a website. There is a list of menus available in a theme in a configuration file &#8211; menus.json. These menus are &#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[57],"tags":[56,32,64,63,50],"class_list":["post-401","post","type-post","status-publish","format-standard","hentry","category-theme-back-end","tag-back-end","tag-menus","tag-navigation","tag-settings","tag-theme"],"_links":{"self":[{"href":"https:\/\/www.frozenlogistic.com\/index.php?rest_route=\/wp\/v2\/posts\/401","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.frozenlogistic.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.frozenlogistic.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.frozenlogistic.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.frozenlogistic.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=401"}],"version-history":[{"count":3,"href":"https:\/\/www.frozenlogistic.com\/index.php?rest_route=\/wp\/v2\/posts\/401\/revisions"}],"predecessor-version":[{"id":403,"href":"https:\/\/www.frozenlogistic.com\/index.php?rest_route=\/wp\/v2\/posts\/401\/revisions\/403"}],"wp:attachment":[{"href":"https:\/\/www.frozenlogistic.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=401"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.frozenlogistic.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=401"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.frozenlogistic.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=401"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}