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" style="cloud-city"/]

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. If a custom style is used it must be defined in both the countdown and the units 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:

Now we add all the digits, starting with weeks:

Weeks
0
0

Days:

Days
0
0

Hours:

Hours
0
0

Minutes:

Minutes
0
0

Seconds:

Seconds
1
4

Print-Pro-Matic: Add PDF to Print Page

The following is an example of how to add a pdf document to be printed along with a target using the new add_print_url attribute.

First, we need a simple target to print:

<div id="print_target">This is the simple print target for the page</div>

Now, we siply add our print-me shortcode and use the add_pdf_url attribute to include a pdf document to be printed:

[print-me target="#print_target" add_pdf_url="http://spacedonkey.de/wp-content/uploads/2012/06/RomeSweetRome1-8v22.pdf" pause_time="3000"/]

Collapse-O-Matic External Triggers for Nested Element

Here is a nested expand to test this issue.

[expand title="Level 1" id="q1" rel="top-highlander" trigclass="must-be-one" expanded="true"]
   [expandsub1 title="Nested Level a1" id="a1" rel="a-highlander"]answer a1[/expandsub1]
   [expandsub1 title="Nested Level a2" id="a2" rel="a-highlander"]answer a2[/expandsub1]
[/expand]
[expand title="Level 2" id="q2" rel="top-highlander" trigclass="must-be-one"]
   [expandsub1 title="Nested Level b1" id="b1" rel="b-highlander"]answer b1[/expandsub1]
   [expandsub1 title="Nested Level b2" id="b2" rel="b-highlander"]answer b2[/expandsub1]
[/expand]
Level 1
Nested Level a1
answer a1
Nested Level a2
answer a2
Level 2
Nested Level b1
answer b1
Nested Level b2
answer b2

Here are some external triggers:

<a class="expandanchor" href="#q1">Level 1</a>
<a class="expandanchor" href="#a1">Level 1a</a>
<a class="expandanchor" href="#a2">Level 1b</a>
<a class="expandanchor" href="#q2">Level 2</a>
<a class="expandanchor" href="#b1">Level 2a</a>
<a class="expandanchor" href="#b2">Level 2b</a>

Level 1
Level 1a
Level 1b
Level 2
Level 2a
Level 2b

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

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

Launch Strtotime: september [this_year] first monday
Weeks
3
8
Days
0
2
Hours
1
8
Minutes
0
5
Seconds
1
4

As of version 1.8.2, using these shortcodes will automatically recalculate for next year’s date after the holiday has past. Holidays should be set as recurring ‘Yearly’ and they will automatically be rescheduled for next year.

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
  • Easter: [this_easter]
  • Ascension Day: [this_easter] + 40 days
  • Pentecost: [this_easter] + 50 days
  • 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]

Tests

Ascension Day

Weeks
2
3
Days
0
4
Hours
1
8
Minutes
0
5
Seconds
1
4

The target date is: Thu, 25th May, 2017

Eight Days before Thanksgiving

november [this_year] fourth thursday + 14 hours 30 minutes – 8 days

Weeks
4
8
Days
0
4
Hours
0
8
Minutes
3
5
Seconds
1
4

The target date is: Wed, 15th November, 2017

Collapse-O-Matic, Graphene Theme & Any Mobile Switcher Test

First let’s test the mobile-only and mobile-exclude shortcodes to see if they are included with the plugin. No, they are not.

Now we install the Graphene Theme and test…
Oops, wrong Graphene Theme. It seems This Theme is all that is required for testing the shortcodes.

Mobile Only

[[mobile only]...[/mobile-only]]
[mobile only] this is some text that should only show up on mobile devices
[/mobile-only]

Mobile Exclude

[[mobile exclude]...[/mobile-exclude]]
[mobile-exclude] this is some text that should only show up on non-mobile devices
[/mobile-exclude]