Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the pue-sales domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /home/staging-poc/public_html/wp-includes/functions.php on line 6114

Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the better-click-to-tweet domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /home/staging-poc/public_html/wp-includes/functions.php on line 6114

Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the pue-amazon domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /home/staging-poc/public_html/wp-includes/functions.php on line 6114

Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the pue-stats domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /home/staging-poc/public_html/wp-includes/functions.php on line 6114

Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the wordpress-seo domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /home/staging-poc/public_html/wp-includes/functions.php on line 6114
Number of days remaining until .... | Event Espresso - Staging Server

Support

Home Forums Event Espresso Premium Number of days remaining until ….

Number of days remaining until ….

Posted: February 16, 2014 at 3:29 am

Viewing 0 reply threads


Jake Vizner

February 16, 2014 at 3:29 am

Hi,

Is there a widget or add-on available that could display a number of days left until a specific event start daye? There is a good example on this website: http://www.toastmasters-d18.org/

I’d would like to do the same for one of the Event Espresso events defined on the Espresso Calendar.

Thank you,

Jake


Dean

  • Support Staff

February 17, 2014 at 2:16 am

Hey Jake,

Best thing to do here is create a custom shortcode.

I whipped this up, it’s VERY basic, but should give you an idea as to what can be achieved.

And yes, I hardcoded the site URL for the registration URL, so that needs to be changed.

[eecountdown event_id=”1″]

function eecountdown($atts) {
	extract(shortcode_atts(array('event_id' => ''), $atts));
$event_id = "{$event_id}";

	global $wpdb, $espresso_manager, $current_user, $org_options;

	$sql = "SELECT * FROM " . EVENTS_DETAIL_TABLE . " WHERE id = '$event_id'";

	$event = $wpdb->get_row($sql);

//uncomment below to see the $event array
//echo "<pre>" . print_r($event, 1) . "</pre>";
	$current_date = strtotime(date('Y-m-d'));
	$start_date = strtotime($event->start_date);

	$time_remaining = $start_date - $current_date;
	$time_remaining = floor($time_remaining/(60*60*24));

?>

<h2><?php echo $time_remaining; ?></h2>
<p>Days remaining until</p>
<p><?php echo $event->event_name; ?></p>
<p><?php echo apply_filters('filter_hook_espresso_display_featured_image', $event_id, !empty($event_meta['event_thumbnail_url']) ? $event_meta['event_thumbnail_url'] : '');?></p>

<p><?php echo espresso_format_content($event->event_desc); ?></p>
<p><a href="http://www.XXXX.com/event-registration/?ee=<?php echo $event_id;?>">Register Now</a>
<?php
}
add_shortcode('eecountdown','eecountdown');
  • This reply was modified 11 years ago by Dean. Reason: commented out a debug line
Viewing 0 reply threads

The support post ‘Number of days remaining until ….’ is closed to new replies.

Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.

Event Espresso - Staging Server