WordPress plugin intelligence profile

Conditional Tags Shortcode

A shortcode to display content based on context.

WP PlugIndex snapshot

Current directory snapshot

Tested up to WordPress 5.4
Current version0.2
WordPress coverageTested up to WordPress 5.4
Minimum stackWP 3.1 · PHP —
Directory statusactive
Last directory update26 May 20206y ago
Active installations100Adoption metric — not a quality score
WordPress.org rating5.0 / 5 from 2 ratings
Official packageDirect from WordPress.org

Repository metrics are context, not quality scores. Active installations measure adoption and can strongly reflect a plugin’s age and historical popularity. Ratings, recent updates and “Tested up to” metadata also do not guarantee modern code, error-free operation, security, feature completeness or suitability for a particular site. Why active installs don’t tell the whole story →

WP PlugIndex currently records Conditional Tags Shortcode version 0.2 as active, updated 6y ago and tested up to WordPress 5.4.

Overview

About this plugin

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]

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. 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]

WordPress.org metadata

Plugin tags

Topics listed for this plugin in the WordPress.org directory.

  • conditional tags
  • context
  • page
  • shortcode
Compatibility & maintenance

Compatibility & maintenance

Tested up to WordPress 5.4

Not yet marked as tested with WordPress 7.1. WordPress.org currently lists Tested up to 5.4.

Current WordPress releaseWordPress 7.1
WordPress.org Tested up to5.4
Minimum requirementsWordPress 3.1 · PHP not listed
Update activity26 May 20206y ago

“Tested up to” is directory metadata supplied by the plugin author. WP PlugIndex does not turn an older declaration into a claim that the plugin is incompatible.

Changes recorded by WP PlugIndex

Recent tracked changes

No tracked version or compatibility changes have been recorded by WP PlugIndex yet.

Tracking & source

WP PlugIndex tracks public WordPress.org directory metadata and records selected version, compatibility and availability changes as they are detected.

Plugin watchlist

Watch this plugin

Sign in to your WP PlugIndex account or create a free account. Free accounts can watch up to 5 plugins and see what changed.

Watch limit

Watchlist limit reached

You have reached your current active watch limit.