Can I show the timer of Countdown Dynamite in the sidebar of my site?

Yes, you can. Please add the "Text" (Arbitrary text or HTML) widget in your sidebar, and then add the countdown dynamite shortcode to the widget.

When using the Countdown Dynamite shortcode outside of the content area of a post or page (for example, in the sidebar) you have to specify the post_id parameter in the shortcode. For example:

[countdown-dynamite post_id="109"]

(Don't forget to add "quotes" around the post id number).

This is because the plugin settings and user tracking are tied to a specific post/page. If the parameter is not specified, the plugin will use what WP reports as "current post" if any, which may lead to unpredictable results.

Keep in mind that the redirect function doesn't work if used outside of post/page as it may render every page of a site inaccessible if enabled by mistake.

The post/page referred by post_id parameter must have Countdown Dynamite enabled. It doesn't have to contain the shortcode and could be even an empty draft.

To find out the ID of a post/page, simply open it for editing in WP admin and read the "post" parameter from the URL. For example:

some-site.com/wp-admin/post.php?post=18&action=edit

Article Details