How to caculate a countdown to the next high and low tide.
First, there is a nice plugin called Tides Today UK and Ireland tide times that allows tidal charts to be displayed using a Sidebar Widget or a shortcode. For example:
[tide_times days=1 title="Tide times for Leith" location="leith"]These are today's tides for Leith[/tide_times]
That outputs a tidy forecast like so:
Tide times for Leith
These are today’s tides for Leith
The shortcode references the authors own web-service api that returns a JSON encoded dataset. Here is the dataset for Leith. However, the plugin author clearly (if not threateningly) states:
You may not use the data provided by the API for anything other than displaying tide information on your website by the
means provided by this plugin.
…Failure to comply with any of the conditions outlined here or as outlined in the Tides Today Terms and conditions will result in legal action being taken.
In the words of Al Swearengen:
Not a tone to get a deal done.
Even though the datasource provide is from the UK Hydrographic Office:
All data is provided by the UK Hydrographic Office and is provided under license. Crown Copyright 2016.
So we might need to find our own, tax-funded, public, non-threatening api to get our tidal info from, for example:
The NOAA api looks quite promising… but it’s only for North America. So we move on to Worworldtides api which provides 1000 free calls per month. So far that is a winner. Now let’s take a look at The National Tidal and Sea Level Facility. It seems it only serves the UK and Ireland. Here is Leith.
Introducing a new attribute for Archive-Pro-Matic: highlight
highlight will accepts the following values:
We have added a bit of css to highlight each of the classes:
border-left: 2px solid red;
border-left: 2px solid blue;
Assigning ‘current-year’ as the value of the highlight attribute will add a
current-year class to the current year in the list:
[archives type="yearly" cat_id="4" limit="5" highlight="current-year"/]
Assigning ‘active-year’ would only be used on the archive page itself. To see this in action, first visit the an archive page, say 2014 and on that page place an archive list using the sidebar widget or following shortcode.
[archives type="yearly" cat_id="4" limit="5" highlight="active-year"/]
This is just a simple test of a span with a rel attribute:
Monkeys are funny.
and now a div:
Donkeys are also funny.
Works fine while in text mode. Now let’s switch to Visual mode.
Archive-Pro-Matic version 1.0.4 introduces two new attributes: alpha_headings and alpha_tag
[archives type="alpha" cat_id="4" limit="10" alpha_headings="true"/]
[archives type="alpha" cat_id="4" limit="10" alpha_headings="true" alpha_tag="strong"/]
The roll-your-own method does not work easily, as we have no way of targeting only the expanded state.
<span title="this trigger" class="collapseomatic" id="testme">this trigger</span>
<span class="collapseomatic_content" id="target-testme">hidden content</span>
This is an example of some text that has a trigger placed inline, meaning that the trigger does not break the flow of the text. However, when this triggerhidden content is clicked and the target is expanded, the target would break the paragraph as a display: block element. Naturally, when the element is collapsed, the inline flow returns.
This is an example of some text that has a trigger placed inline, meaning that the trigger does not break the flow of the text. However, when this trigger
is clicked and the target is expanded, the target would break the paragraph as a display: block element. Naturally, when the element is collapsed, the inline flow returns.
This is an example of how a limited time offer would work in conjunction with content in a collapse-o-matic expand element.
This demo uses T(-) Countdown Control with a cookie that tracks when the offer expires for each unique visitor. Once the countdown reaches zero, T(-) Countdown Events will remove any special offer items.
For this demo, we’ll set the special timer for just two minutes. The offer will then be removed for 24 hours, and then after the 24 hours are past, the offer will reset.
this is where the details of the special are presented
This is a test of the new T(-) Opening Hours add-on plugin for T(-) Countdown Control.
It will allow a countdown schedule to be defined by referencing a weekly opening schedule.
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:
[tminus_digit cid=”281″ id=”explode” unit=”weeks” style=”cloud-city” omitweeks=”false”/]
[tminus_digit cid=”281″ id=”explode” unit=”days” style=”cloud-city”/]
[tminus_digit cid=”281″ id=”explode” unit=”hours” style=”cloud-city”/]
[tminus_digit cid=”281″ id=”explode” unit=”minutes” style=”cloud-city”/]
[tminus_digit cid=”281″ id=”explode” unit=”seconds” style=”cloud-city”/]