Skip to main content

i4w_onlyfor

Usage

This shortcode is designed to segment content on a page, post, excerpt or text widget by displaying the embedded content only to those subscribers whose memberships or Keap contact ID match the criteria passed as parameters. There are three variants, depending on the parameters used.

[ELSE_onlyfor] conditional branching is supported.

Shortcode nesting is supported: [i4w_onlyfor1] thru [i4w_onlyfor19]

[ELSE_onlyfor1] thru [ELSE_onlyfor19]

Parameters

ParameterDescriptionDefaultRequired
tagidOne or more tag ID's taken from Keap. If more than one is entered, please separate with commas.NoneYes, if contactid is not passed
contactidOne or more contact ID's taken from Keap. If more than one is entered, please separate with commas.NoneYes, if tagid is not passed
excl_tagidOne or more tag ID's taken from Keap which, if passed, will exclude anyone with any of these tag ID's, regardless of whether other criteria is met. If more than one is entered, please separate with commas.NoneNo
excl_contactidOne or more contact ID's taken from Keap which, if passed, will exclude anyone with any of these contact ID's. If more than one is entered, please separate with commas.NoneNo
require_all_tagsSpecifies whether ALL tags must be present in order to satisfy the "IF" condition.NoneNo

Example

Based on Keap tag ID:

Shortcode
[i4w_onlyfor tagid='123,456,789']
content-content-content
[ELSE_onlyfor]
alternate-content-alternate-content
[/i4w_onlyfor]

Based on Keap tag ID and excluding some contact ID's:

Shortcode
[i4w_onlyfor tagid='123,456,789' excl_contactid='56,43']
content-content-content
[ELSE_onlyfor]
alternate-content-alternate-content
[/i4w_onlyfor]

Based on Keap cumulative contact ID's and tag ID's:

Shortcode
[i4w_onlyfor tagid='123,456,789' contactid='4321,6543,9876']
content-content-content
[ELSE_onlyfor]
alternate-content-alternate-content
[/i4w_onlyfor]

Based on Keap cumulative contact ID's and requiring ALL tag ID's to be present:

Shortcode
[i4w_onlyfor tagid='123,456,789' require_all_tags='1' contactid='4321,6543,9876']
content-content-content
[ELSE_onlyfor]
alternate-content-alternate-content
[/i4w_onlyfor]

Based on Keap contact ID and tag ID and excluding some contact ID's and tag ID's:

Shortcode
[i4w_onlyfor contactid='4321,6543,9876' tagid='123,456,789' excl_contactid='23,45,56' excl_tagid='87,65,32']
content-content-content
[ELSE_onlyfor]
alternate-content-alternate-content
[/i4w_onlyfor]

When nesting [i4w_onlyfor] or [i4w_hidefrom] shortcodes within one another, add a number to reflect the nesting level:

Shortcode
[i4w_hidefrom1 tagid='987,654,321']
[i4w_onlyfor2 tagid='123,456,789']
content-content-content
[ELSE_onlyfor2]
alternate-content-alternate-content
[/i4w_onlyfor2]
[/i4w_hidefrom1]