Skip to content Skip to sidebar

This thread is resolved. Here is a description of the problem and solution.

Problem:
If you're experiencing an issue where your event dates are displaying as '1 January 1970' instead of the actual start and end dates on your website using the Avada theme, this might be due to a conflict with WPML.
Solution:
We recommend the following steps to address this issue:
1. Ensure you have a backup of your website.
2. Add the following code to your theme's functions.php file:

/* Workaround for compsupp-8340 */<br />add_filter( 'fusion_set_dynamic_params', function( $params ) {<br />    if ( isset( $params['event_date']['callback']['function'] ) ) {<br />        $params['event_date']['callback']['function'] = 'wpml_compsupp8340_fix_avada_event_full_date';<br />    }<br />    return $params;<br />}, 20 );<br /><br />function wpml_compsupp8340_fix_avada_event_full_date( $args, $post_id = 0 ) {<br />    // Function implementation here<br />}

3. Test this solution in a staging environment before applying it to your live site to ensure it does not cause other issues.

Please note that this solution might become irrelevant due to updates or may not apply to your specific case. If this solution does not resolve your issue or if you encounter other problems, we highly recommend checking related known issues at https://wpml.org/known-issues/, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. If further assistance is needed, feel free to open a new support ticket at WPML support forum.

This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.

Tagged: 

This topic contains 5 replies, has 1 voice.

Last updated by Dražen 3 weeks ago.

Assisted by: Dražen.

Author Posts
April 13, 2026 at 4:46 pm #17966762

eugenio-mariaE
Site owner

The error is visible at this page:
hidden link
as you can see, the postcard shows the epoch time "1 January 1970" instead of the start and end dates.
I opened a ticket with avada CS but they told us that the conflict is with WPML, deactivating it resolves the problem.
What can we do for resolve?
thanks

April 15, 2026 at 6:17 am #17970276

Marcel
Supporter

Languages: English (English ) Spanish (Español ) German (Deutsch )

Timezone: Europe/Vienna (GMT+02:00)

Hi,

before your ticket is assigned to one of my colleagues, please allow me to walk you through some initial debugging steps. This will help speed up the support process.

This should be actually a unix timestamp. Do you have a staging environment where we can test that?

I would eventually also need to request temporary access (WP-Admin and FTP) to your site
– preferably to a test site where the problem has been replicated if possible –
in order to be of better help and check if some configurations might need to be changed

Your next answer will be private which means only you and I have access to it.

❌ Please backup your database and website ❌

✙ I would additionally need your permission to de-activate and re-activate Plugins and the Theme, and to change configurations on the site. This is also a reason the backup is really important.

✙ Please add the Links to the […] Edit Screen, the Page/Post where you insert the […] and the corresponding Front End Page/Screen

Best Regards
Marcel

April 17, 2026 at 9:47 am #17976356

Dražen
Supporter

Languages: English (English )

Timezone: Europe/Zagreb (GMT+02:00)

Hi,

Thank you for your patience.

I was able to reproduce the issue on my end on new test site, and it appears to be an bug.

I have now escalated this to our compatibility team for further investigation. I will keep you updated as soon as I have more information.

Regards,
Dražen

April 23, 2026 at 5:01 am #17988986

Dražen
Supporter

Languages: English (English )

Timezone: Europe/Zagreb (GMT+02:00)

Hello,

issue seems to be coming from Avada code, so we will report it to them, please do the same to speed things up.

In plugins/fusion-builder/inc/class-fusion-dynamic-data-callbacks.php Avada uses strtotime() to convert the date that was already formated by TEC.

In the meantime you can use next workaround, but please test it first to it does not cause any other issue:

- Make a backup
- Add the following to functions.php

/* Workaround for compsupp-8340 */
add_filter( 'fusion_set_dynamic_params', function( $params ) {
	if ( isset( $params['event_date']['callback']['function'] ) ) {
		$params['event_date']['callback']['function'] = 'wpml_compsupp8340_fix_avada_event_full_date';
	}

	return $params;
}, 20 );

function wpml_compsupp8340_fix_avada_event_full_date( $args, $post_id = 0 ) {
	$post_id = ! empty( $args['event_id'] ) ? absint( $args['event_id'] ) : $post_id;

	if ( ! $post_id ) {
		$post_id = apply_filters( 'fusion_dynamic_post_id', get_the_ID() );
	}

	$post = get_post( $post_id );
	if ( ! $post instanceof WP_Post || 'tribe_events' !== $post->post_type ) {
		return '';
	}

	$args['event_date_type'] = isset( $args['event_date_type'] ) ? $args['event_date_type'] : 'both';
	$args['format']          = ! empty( $args['format'] ) ? $args['format'] : '';

	if ( 'start_event_date' === $args['event_date_type'] ) {
		return tribe_get_start_date( $post_id, true, $args['format'] );
	}

	if ( 'end_event_date' === $args['event_date_type'] ) {
		return tribe_get_end_date( $post_id, true, $args['format'] );
	}

	if ( ! $args['format'] ) {
		add_filter( 'tribe_events_recurrence_tooltip', [ 'Fusion_Dynamic_Data_Callbacks', 'remove_event_recurring_info' ], 999 );
		$date = tribe_events_event_schedule_details( $post_id, '', '', false );
		remove_filter( 'tribe_events_recurrence_tooltip', [ 'Fusion_Dynamic_Data_Callbacks', 'remove_event_recurring_info' ], 999 );

		if ( ! empty( $args['time_range_sep'] ) ) {
			$date = str_replace( tribe_get_option( 'timeRangeSeparator', ' - ' ), $args['time_range_sep'], $date );
		}

		return $date ?: '';
	}

	$range_separator = ! empty( $args['time_range_sep'] )
		? $args['time_range_sep']
		: tribe_get_option( 'timeRangeSeparator', ' - ' );

	$start_raw = tribe_get_start_date( $post_id, true, Tribe__Date_Utils::DBDATETIMEFORMAT );
	$end_raw   = tribe_get_end_date( $post_id, true, Tribe__Date_Utils::DBDATETIMEFORMAT );

	$start_ts = $start_raw ? strtotime( $start_raw ) : false;
	$end_ts   = $end_raw ? strtotime( $end_raw ) : false;

	if ( ! $start_ts ) {
		return '';
	}

	$start_formatted = wp_date( $args['format'], $start_ts );
	$end_formatted   = $end_ts ? wp_date( $args['format'], $end_ts ) : '';

	return ( ! $end_formatted || $start_formatted === $end_formatted )
		? $start_formatted
		: $start_formatted . $range_separator . $end_formatted;
}

Regards,
Drazen

April 24, 2026 at 7:49 am #17991932

eugenio-mariaE
Site owner

Hi Dražen,
I've reported the issue to the Avada Support as you suggested: i'll keep you updated

Will try the snippet on the website as soon as i can.

Best

April 24, 2026 at 8:04 am #17991956

Dražen
Supporter

Languages: English (English )

Timezone: Europe/Zagreb (GMT+02:00)

Hello,

great, feel free to contact us again if there is some issues.

Kind regards,
Drazen