Evergreen Countdown Timer Shortcode

Below, you’ll find a detailed guide on how to add the Evergreen Countdown Timer Shortcode to your WordPress website, including its parameters, examples, and PHP function code. Additionally, we’ll assist you with common issues that might cause the Evergreen Countdown Timer Plugin shortcode not to show or not to work correctly.

Before starting, here is an overview of the Evergreen Countdown Timer Plugin and the shortcodes it provides:

Plugin Icon
Evergreen Countdown Timer

"Evergreen Countdown Timer is an effective WordPress plugin that allows you to create a sense of urgency with customizable countdown timers. The intelly-countdown slug allows seamless integration."

★★★✩✩ (13) Active Installs: 5000+ Tested with: 6.1.4 PHP Version: 5.6
Included Shortcodes:
  • [ec]

Evergreen Countdown Timer [ec] Shortcode

The Intelly-Countdown Plugin shortcode allows users to create a countdown timer on their WordPress site. Shortcode Name: ICP_ec The shortcode takes an ‘id’ as an attribute, which refers to a specific countdown timer. It retrieves the countdown details using the ‘Manager’ and ‘get’ methods. If the countdown does not exist, it returns nothing. If it does, it starts the output buffer, draws the countdown, gets the buffer content, cleans the buffer, and returns the result. This result is the rendered countdown timer.

Shortcode: [ec]

Parameters

Here is a list of all possible ec shortcode parameters and attributes:

  • id – The unique identifier for the countdown timer

Examples and Usage

Basic example – The basic usage of the intelly-countdown plugin shortcode involves simply referencing the id of the countdown you wish to display.

[ec id=1 /]

For more advanced usage, you can include additional parameters within the shortcode.

Advanced examples:

Displaying a countdown by referencing the countdown ID, and including additional parameters for customization. In this example, we’re including the ‘format’ and ‘expiryText’ parameters. ‘format’ allows you to customize the display format of the countdown, while ‘expiryText’ lets you set a custom message to be displayed when the countdown reaches zero.

[ec id=1 format="dHMS" expiryText="Countdown Complete!" /]

Remember, the ‘id’ parameter is mandatory for the shortcode to function, while other parameters are optional and allow for further customization of the countdown display.

PHP Function Code

In case you have difficulties debugging what causing issues with [ec] shortcode, check below the related PHP functions code.

Shortcode line:

add_shortcode( 'ec', 'ICP_ec' );

Shortcode PHP function:

function ICP_ec( $atts, $content = '' ) {
	global $icp;
	$default   = array(
		'id' => 0,
	);
	$options   = shortcode_atts( $default, $atts );
	$countdown = $icp->Manager->get( $options['id'] );
	if ( false === $countdown ) {
		return;
	}

	ob_start();
	$icp->Ui->Countdown->draw( $countdown );
	$result = ob_get_contents();
	ob_end_clean();
	return $result;
}

Code file location:

intelly-countdown/intelly-countdown/includes/core.php

Conclusion

Now that you’ve learned how to embed the Evergreen Countdown Timer Plugin shortcode, understood the parameters, and seen code examples, it’s easy to use and debug any issue that might cause it to ‘not work’. If you still have difficulties with it, don’t hesitate to leave a comment below.

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *