WPThumbs
Themes Plugins By purpose By industry Best-of lists Fix it guides
Free Plugin by shazdeh v0.2

Conditional Tags Shortcode

A shortcode to display content based on context.

Conditional Tags Shortcode

The facts

Rating
5★ from 2
Active installs
100+
Price
Free
Last updated
26 May 2020
Added
Jan 2015
Requires WP
3.1
Tested up to
WP 5.4.21
Downloads
8,631

Our analysis

AI-assisted

Conditional Tags Shortcode is a WordPress plugin that allows you to control where content is displayed on your site using conditional tags. It enables you to show or hide content based on specific conditions, such as whether a user is on the homepage, a specific page, or a category archive.

You can use various conditional tags provided by WordPress, and even reverse the logic by adding 'not_' before the tag. This plugin is suitable for users who want to customize content visibility based on different criteria without needing to write complex code.

Best for: This plugin suits WordPress users looking to manage content visibility based on specific conditions.

What it does well

  • Free to use from the WordPress.org directory
  • Utilises WordPress's built-in conditional tags
  • Allows for nested conditions for complex displays
  • Can reverse logic for conditional tags
  • Simple shortcode format for implementation

Where it falls short

  • Limited information on additional features
  • Last updated in May 2020, may not be actively maintained

Verdict

Conditional Tags Shortcode offers a straightforward way to control content display on your site. However, users should consider the last update date when evaluating its ongoing support.

From the developer

shazdeh's own description of Conditional Tags Shortcode, lightly tidied.

With this shortcode you can take control of where the content is displayed.

Usage

You can use all the conditional tags WordPress provides. Checkout examples below.

Show text only on the homepage:
[if is_front_page] The text [/if]

Show text only on the About page of the site:
[if is_page=”about”] The text [/if]

Show only on the category archive view:
[if is_category] The text [/if]

You can add “not_” before the conditional tag to reverse the logic, example:
Show on all pages of the site except the homepage:
[if not_is_front_page] The text [/if]

OR

Using multiple parameters, the content is displayed when either of the conditions are met (“OR” comparison), for example, show text on both category and tag archive pages:
[if is_category is_tag] The text [/if]

AND

To set multiple conditions you can nest the shortcode, for example show text only on homepage AND if the user is logged in:
[if is_user_logged_in][if is_front_page] The text [/if][/if]

Show a link to wordpress.org site, only on single post pages and only on mobile devices:
[if wp_is_mobile][if is_single] WordPress [/if][/if]

has_term_{taxonomy}

You can use this to check if the current post in the loops belongs to a custom term in the desired taxonomy. See: https://codex.wordpress.org/Function_Reference/has_term

Example, check if current post has the “jazz” term in the “genre” taxonomy:
[if has_term_genre=”jazz”] The text [/if]

Read the full description on the official page →

Tagged as