November 15, 2014 - Editor Tips, How to, Shortcodes

Schedule to show_content shortcode

NOTE: BUG - causes a 502 Bad Gateway error (PHP SIGSEGV - core dumped) error is embedded within an Events Manager Pro page.

Allows a section of a page to be shown on the web site only during a specified time period.

Note that entire posts can be scheduled to appear with the built-in scheduler and to "disappear" via the "Post Expirator" plugin.

To Use:

In the editor, click the  icon and

select the "content" category, then

select "Schedule to show_content" option

In the "show_from" entry, enter date and time to start showing the content in most any format. If you leave it blank, it will start showing immediately. If you do not put a time, it will start showing at midnight (beginning of the day)

In the "show_until" entry, date and time to stop showing in most any format. If you leave it blank, it will always show after the "show_from" date/time. If you do not put a time, it will stop showing at midnight (beginning of the day).

You can enter text into the "Content" box and/or edit the content after inserting the shortcode.

You can enter the date as "2010-11-12" or "November 12, 2010" to avoid ambiguity*

Time can be entered as " 9:15pm" or "military time" of  "21:15"

Examples

To schedule a message to change at a deadline, use two shortcodes:

[show_content show_from="2014-07-15 8am" show_until="2014-07-31 5pm"]
Make sure to sign up before the close of business on July 31.
[/show_content]

[show_content show_from="2014-07-31 5pm" show_until=""]
Signups have now ended.
[/show_content]

Any content is allowed, including images, links, and other shortcodes.

[show_content show_from="2014-07-15 8am" show_until="2014-07-31 5pm"]

[groups_member group="students"]Content for students[/groups_member]

[groups_member group="faculty"]Content for faculty[/groups_member]

[/show_content]

To make a recurring entry, there are some limitations in how the date in interpreted. For example, stating a day of the week is normally interpreted as the "next week" occurrence, so to make something appear every Friday afternoon, you would specify "Friday this week" as in:

[show_content show_from="Friday this week noon" show_until="Friday this week 11:59pm"]

Have a great weekend!!!  ...more content to show Friday afternoons

[/show_content]

Note that "Friday this week midnight" is valid, but happens 12 hours *before* "Friday this week noon" - you would need to specify "Saturday this week midnight" for 12 hours after Friday noon.

Date Format Ambiguities

*The date can be specified in several formats, but note that ambiguities are resolved as:

  • "11.12.10" is  10th December, 2011
  • "11/12/10" is  12th November, 2010
  • "11-12-10" is  11th December, 2010

Comments are closed.