>
Download This Plugin | |
Download Elegant Themes | |
Name | Conditional Tags Shortcode |
Version | 0.1 |
Author | Hassan Derakhshandeh |
Rating | 0 |
Last updated | 2015-01-29 12:49:00 |
Downloads |
37
|
Download Plugins Speed Test plugin for Wordpress |
Home page PageSpeed score has been degraded by 0%, while Post page PageSpeed score has been degraded by 0%
Conditional Tags Shortcode plugin added 4 bytes of resources to the Home page and 7 bytes of resources to the sample Post page.
Conditional Tags Shortcode plugin added 0 new host(s) to the Home page and 0 new host(s) to the sample Post page.
Great! Conditional Tags Shortcode plugin ads no tables to your Wordpress blog database.With this shortcode you can take control of where the content is displayed. More information can be found at: http://shazdeh.me/wordpress-plugins/conditional-tags-shortcode/
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]
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]
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] <a href="http://wordpress.org/">WordPress</a> [/if][/if]