Usage:

This shortcode is used to display portions of a page or post between two inclusive dates.

By using the ELSE option, alternate content can optionally be displayed when the user doesn’t satisfy the date requirement.

The dates can be specified in any format understood by PHP’s “strtotime()” functions as well as by using contact custom fields holding valid dates.

Any valid date used in the shortcode can also be modified by using an “adjust” parameter to define an “offset” from the basis date, such as “+3 months” or ‘-5 weeks’.

[ELSE_show_between] conditional branching is supported.
Shortcode nesting is NOT supported.

Parameters:

date Specifes the “from” date at which the content segment should be displayed.

If a date is entered, that date will be used as the basis. We recommend using the “YYYY-MM-DD” format to preclude possible errors due to PHP localization which may, at times, misinterpret date formats, such 12/11/2016 (US) and 11/12/2016 (UK) and 11-12-2016 (Europe).

To use a contact’s ActiveCampaign data as the date, you can enter the name of the custom field between percent signs, such as %DATEJOINED% or %BIRTHDATE%. Custom field names can be different from what you intended them to be; please ensure that your are using the correct spelling, as stored in ActiveCampaign.

Finally, the special date parameter #USER_REGISTERED# can be used, in which case, the shortcode will use the user’s WordPress registration date.

Default: none.
Required: yes. If not given or not valid, the shortcode will default to the ELSE content, if included.

date2 Specifes the “to” date after which the content segment should no longer be displayed.

If a date is entered, that date will be used as the basis. We recommend using the “YYYY-MM-DD” format to preclude possible errors due to PHP localization which may, at times, misinterpret date formats, such 12/11/2016 (US) and 11/12/2016 (UK) and 11-12-2016 (Europe).

To use a contact’s ActiveCampaign data as the date, you can enter the name of the custom field between percent signs, such as %DATEEXPIRES% or %CANCELLED%. Custom field names can be different from what you intended them to be; please ensure that your are using the correct spelling, as stored in ActiveCampaign.

Finally, a date adjustment string can be used instead to make the end date relative to the start date. It must follow the rules used by PHP’s strtotime().

Examples:
“+1 day” : Adds one day to the date given in “date”.
“-1 week”: Subtracts sone week from the date.
“+1 week 2 days 4 hours 2 seconds”: Add nine days, 4 hours and 2 seconds to the given date.

Default: none.
Required: yes. If not given or not valid, the shortcode will default to the ELSE content, if included.

Example:

Simple date:

[mbr_show_between date='2016-09-30' date2='2016-12-31']
  Show this before on or after September 30th, 2016 and stop after December 31st, 2016.
[ELSE_show_between]
  Sorry, you missed the "window"...
[/mbr_show_between]

Simple adjusted date:

[mbr_show_between date='2016-09-30' date2='+90 days'']
  Show this on or after September30th, 2016 and stop after 90 days.
[ELSE_show_between]
  Sorry, you missed the "window"...
[/mbr_show_between]

Contact based date:

[mbr_show_between date='%DATEJOINED%' date2='2016-12-31']
  content-content-content
[ELSE_show_between]
  alternate-content-alternate-content
[/mbr_show_between]

Adjusted contact based date:

[mbr_show_between date='%DATEJOINED%' date2='+90 days']
  content-content-content
[ELSE_show_between]
  alternate-content-alternate-content
[/mbr_show_between]

API:

There is currently no ActiveMember360 API function equivalent for this shortcode.