Introduction

The If shortcode is primarily going to be used for templates or snippets, where you want to show different content for different pages/posts. This shortcode allows you to use same code across a number of pages and still have some control over what is shown.

If examples

The following shortcode will show the inner content only if the current page or post id is equal to 372. The actual shortcode is generated on the right.
[intense_if postid=”3728″ selector=”equal”]
[intense_alert color=”error” font_color=”#ffffff” border_radius=”5px” block=”1″]
This alert is shown because the the current page/post id is 3728
[/intense_alert]
[/intense_if]
This alert is shown because the the current page/post id is 372

The following shortcode will show the inner content only if the current page or post id is not in the list of id’s. The actual shortcode is generated on the right.
[intense_if postid=”3727,3729″ selector=”not”]
[intense_alert color=”error” font_color=”#ffffff” border_radius=”5px” block=”1″]
This alert is shown because the the current page/post id is 3728, which is not in the list of id’s.
[/intense_alert]
[/intense_if]
This alert is shown because the the current page/post id is 3728, which is not in the list of id’s.

Explore More Shortcodes

[intense_content_section]
<h2>Introduction</h2>
The If shortcode is primarily going to be used for templates or snippets, where you want to show different content for different pages/posts. This shortcode allows you to use same code across a number of pages and still have some control over what is shown.
[/intense_content_section]
[intense_content_section background_type="color" background_color="#f9f9f9" border_top="1px solid #ededed" border_bottom="1px solid #ededed"]
<h2>If examples</h2>
[intense_row padding_top="0"]
[intense_column size="6" medium_size="6"]
The following shortcode will show the inner content only if the current page or post id is equal to 372. The actual shortcode is generated on the right.
[intense_spacer type="block" height="20"]
[intense_if postid="3728" selector="equal"]
[intense_alert color="error" font_color="#ffffff" border_radius="5px" block="1"]
This alert is shown because the the current page/post id is 3728
[/intense_alert]
[/intense_if]
[/intense_column]
[intense_column size="6" medium_size="6"]
[intense_if postid="3728" selector="equal"]
[intense_alert color="error" font_color="#ffffff" border_radius="5px" block="1"]
This alert is shown because the the current page/post id is 372
[/intense_alert]
[/intense_if]
[/intense_column]
[/intense_row]
<hr>
[intense_row padding_top="30"]
[intense_column size="6" medium_size="6"]
The following shortcode will show the inner content only if the current page or post id is not in the list of id's. The actual shortcode is generated on the right.
[intense_spacer type="block" height="20"]
[intense_if postid="3727,3729" selector="not"]
[intense_alert color="error" font_color="#ffffff" border_radius="5px" block="1"]
This alert is shown because the the current page/post id is 3728, which is not in the list of id's.
[/intense_alert]
[/intense_if]
[/intense_column]
[intense_column size="6" medium_size="6"]
[intense_if postid="3727,3729" selector="not"]
[intense_alert color="success" font_color="#000" border_radius="8px" block="1"]
This alert is shown because the the current page/post id is 3728, which is not in the list of id's.
[/intense_alert]
[/intense_if]
[/intense_column]
[/intense_row]
[/intense_content_section]
[intense_snippet snippet_id="Child Theme | Shortcodes/footer" snippet_title="Shortcode Page Footer"]