Mix languages in a WordPress post / pages with a simple shortcode and gettext Shield.io – Quality metadata badges for your open source project
Development     Essentials     WordPress    

Conditional Tags for Menus & Widgets

11. May 2015

Conditional Tags are a powerful thing in WordPress and especially handy to show or hide things.

“The Conditional Tags can be used in your Template files to change what content is displayed and how that content is displayed on a particular page depending on what conditions that page matches. ”

Two plugins are part of my essentials, that utilize the Conditional Tags:

  1. Widget Logic
    “This plugin gives every widget an extra control field called “Widget logic” that lets you control the pages that the widget will appear on. The text field lets you use WP’s Conditional Tags, or any general PHP code.”
  2. Menu Item Visibility Control
    “Using this plugin you can use WordPress Conditional Tags to enable or disable menu items on the front-end. It works like ‘Widget Logic’ but for menu items.”

You can easily define your own Conditional Tags in your functions.php or plugin.

Leave a Reply

Be the First to Comment!

Notify of