• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
WPFeed

WPFeed

  • News
  • Tutorials
    • WordPress Multisite
    • BuddyPress
    • Design
  • Reviews
    • Plugins
  • Roundups
  • Snippets
  • Giveaways
Home » Roundups » Using Conditional Tags With WordPress Menu

Using Conditional Tags With WordPress Menu

Conditional tags is a  powerful “tool” to control the layout of your WordPress theme. It helps you to control what content is displayed on a particular page that matches the conditions you’ve set.

Previously, we’ve shown you how to create conditional menu based on user roles. However, in today’s tutorial, we’ll show something better, where we’re going to use conditional tags with WordPress menu.

If Menu Plugin

First, we’ll be using a plugin called If Menu. Simply install and activate the plugin, and you’ll see a new drop-down to choose where the item of the menu will be displayed. Tick on the checkbox to enable the feature on your menu item. Then, you’ll see two dropdowns just below it.

conditional-tags-with-WordPress-menu

As you can see, there are plenty of conditional tags available there. As an example for this tutorial, I’ve set the Sample Page item to be displayed on front page only and therefore it will be hidden on other pages.

homepage-menu
Sample Page Menu Item for Home Page Only

Additionally, due to many requests by users, the plugin author has introduced a filter if you’d like to add your own conditional checks to the dropdown. Please see the FAQ page for more information about this.

Menu Item Visibility Control Plugin

Menu Item VIsibility Control plugin is much easier to use, more like Widget Logic plugin but for the menu. Once activated, you’ll see text field.

Menu-Item-Visibility-Control

Simply put any conditional tag in the text field to choose where the item will be displayed.

If you’ve any question regarding this tutorial, please leave your comment below or If you’ve any question related to WordPress, feel free to get in touch with us through our contact page.

Reader Interactions

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Primary Sidebar

Recent Posts

  • WordPress is a brilliant platform that is loaded with tons of stuff for websites.
  • How to Sync Stock & Price for WooCommerce Products
  • How to migrate a WooCommerce Store to a new site
  • How to Import WooCommerce Products
  • How to export WooCommerce Orders

Copyright © 2023 · WPFeed.com - A Project of TechAbout LLC.

  • About us
  • Advertise
  • Write for us
  • Terms and Conditions
  • Privacy Policy
  • Contact us