Featured

Collapse-Pro-Matic Expand_On Attribute

[expand title="Trigger Text" expand_on="is_search"]Target Text[/expand]

Trigger Text
Target Text

This new conditional expand feature is based on a request by user thisimnot. We introduce a new attribute called expand_on that accepts a comma separated list of WordPress Conditional Tags that will auto-expand the element if true.

For example. The following element should be displayed as collapsed when viewing the front (blog) page, but when viewing the single post or the search results page it will be shown as expanded.

[expand title="Trigger Text" expand_on="is_single, is_search"]Target Text[/expand]

Trigger Text
Target Text

T(-) Countdown Control – Separating the Time Units

Normally a countdown groups the units of time (weeks, days, hours, minutes and seconds) into a single countdown unit. But what if you wanted to break out these units and have them displayed on different parts of the page?

Step One. We will need to add a new attribute that tells the countdown NOT to display any of the digits. This way all the countdown scripts and details are still loaded, but the countdown is not displayed. Something like:

[tminus cid="123" hidden="true"/]

Step Two. A new shortcode will need to be created for displaying the time unit. We will need to know the countdown id (cid) the time unit to be displayed, and the style to be used, if other than the default style set up on the plugin settings like so:

[tminus_digit cid="123" unit="hours" style="cloud-city"]

The final set will be to modify the countdown script to locate the time units, even if they are not wrapped in a countdown dashboard.

Let’s get started.

Here is a hidden countdown:

scheudle 3

Days
0
0
Hours
0
0
Minutes
0
0
Seconds
0
4
2016-09-29 06:56:45

T(-) Countdown Control – Calculating Labor Day & Other Holidays

Using the new [this year] shortcode introduced with T(-) Countdown version 1.8, it’s easy to calculate holidays such as labor day like so:

Launch Strtotime: september [this_year] first monday
Days
3
4
0
Hours
1
7
Minutes
0
3
Seconds
1
9

Other Holidays can be calculated in the same manner:

  • New Years: first day of january [this_year]
  • Martin Luther King, Jr. Day: january [this_year] third monday
  • President’s Day: february [this_year] third monday
  • Memorial Day: last monday of may
  • Independence Day: july 4 [this_year]
  • Labor Day: september [this_year] first monday
  • Columbus Day: october [this_year] second monday
  • Veteran’s Day: november 11 [this_year]
  • Thanksgiving Day: november [this_year] fourth thursday
  • Christmas Day: december 25 [this_year]