{"id":102064,"date":"2012-11-01T22:10:02","date_gmt":"2012-11-02T02:10:02","guid":{"rendered":"http:\/\/wpmu.org\/?p=102064"},"modified":"2012-11-01T22:15:16","modified_gmt":"2012-11-02T02:15:16","slug":"how-to-add-conditional-menus-to-wordpress","status":"publish","type":"post","link":"https:\/\/wpmudev.com\/blog\/how-to-add-conditional-menus-to-wordpress\/","title":{"rendered":"How to Add Conditional Menus to WordPress"},"content":{"rendered":"<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/wpmudev.com\/blog\/wp-content\/uploads\/2012\/11\/banner-772x250-2.png\" alt=\"Post image\" aria-hidden=\"true\" title=\"banner-772x250 (2)\" width=\"772\" height=\"250\" class=\"aligncenter size-full wp-image-102069\" \/><br \/>\nUsing the built in WordPress <a href=\"http:\/\/codex.wordpress.org\/Navigation_Menus\" title=\"WordPress navigation menus\" target=\"_blank\">navigation menus<\/a> is the most convenient way to handle custom menus since the 3.0 release. Since then, developers have written all kinds of plugins to add additional functionality to this theme feature.<\/p>\n<p><a href=\"http:\/\/wordpress.org\/extend\/plugins\/if-menu\/\" title=\"If Menu\" target=\"_blank\">If Menu<\/a> is the latest plugin written to extend WordPress navigation menus. It allows you to show or hide individual menu items based on conditional statements, such as whether or not a user is logged in, various user roles, and the type of content being viewed, (ie, front page, single, page).<\/p>\n<p>When the plugin is enabled, each menu item will get a new checkbox option to &#8220;Enable Conditional Logic&#8221;. <\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/wpmudev.com\/blog\/wp-content\/uploads\/2012\/11\/conditional-menu.jpg\" alt=\"Post image\" aria-hidden=\"true\" title=\"conditional-menu\" width=\"463\" height=\"413\" class=\"aligncenter size-full wp-image-102071\" \/><\/p>\n<p>The plugin currently includes several conditional statements and the developer will be adding more in future releases. You can also add your own by following the instructions on the <a href=\"http:\/\/wordpress.org\/extend\/plugins\/if-menu\/faq\/\" target=\"_blank\">FAQ page<\/a>. <\/p>\n<p>If you need to apply conditional logic to individual menu items within the native WordPress navigation menus, this plugin offers you the easiest way to do that. Download the <a href=\"http:\/\/wordpress.org\/extend\/plugins\/if-menu\/\" title=\"If Menu plugin for conditional WordPress menus\" target=\"_blank\">If Menu<\/a> plugin for free from the WordPress plugin repository.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>If you need to apply conditional logic to individual menu items within the native WordPress navigation menus, this plugin offers you the easiest way to do that.<\/p>\n","protected":false},"author":4099,"featured_media":102078,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"blog_reading_time":"","wds_primary_category":0,"wds_primary_tutorials_categories":0,"footnotes":""},"categories":[4],"tags":[87],"tutorials_categories":[],"class_list":["post-102064","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-plugins","tag-menus"],"_links":{"self":[{"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/posts\/102064","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/users\/4099"}],"replies":[{"embeddable":true,"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/comments?post=102064"}],"version-history":[{"count":0,"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/posts\/102064\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/media\/102078"}],"wp:attachment":[{"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/media?parent=102064"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/categories?post=102064"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/tags?post=102064"},{"taxonomy":"tutorials_categories","embeddable":true,"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/tutorials_categories?post=102064"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}