All 41 Countdown Timer answers

See every answer

Answer

Can I put a countdown in a template?

Updated Countdown Timer 1.12.0Tested with WordPress 7.1

Yes. Countdown Timer works in any theme template: echo its shortcode through WordPress's do_shortcode() where the timer should appear.

PHP
<?php echo do_shortcode( '[trasl_countdown campaign="12"]' ); ?>
  • Copy the campaign's own shortcode from Campaigns (click it to copy). It names the campaign by its ID, so renaming the campaign later does not break the template. A name such as campaign="Black Friday" works too, until the name changes.
  • Any other attribute overrides the campaign for that one spot: heading, template, units, size, align, accent, labels and after.
  • For a one-off with no campaign, give an end date, year first, in your site's time zone: [trasl_countdown ends="2030-12-24 17:00"].

Page caching needs nothing extra. The end is written into the page as one exact moment and the script counts to it from the visitor's own clock, so a cached copy still shows the right time. When the shortcode draws nothing, anyone who can edit posts sees a note saying why; visitors see nothing.

Still stuck? Ask the developers who wrote it. We aim to reply within one business day.

Countdown Timer

Countdown timers that run to your real sale dates, on a product, across the shop, or as a cart timer at the checkout.

From $19 a year · every feature · 30-day refund

Buy Countdown TimerSee the plugin

The product page for a Kangaroo Pocket Hoodie, reduced from $52 to $42. Under the price, the heading Sale price ends in sits above four dark flip tiles counting days, hours, minutes and seconds. A red ribbon across the top of the page reads: Autumn sale on hoodies and beanies ends in, with a running clock and a Shop the sale button.