Comments 1seotijger started the conversationJanuary 2, 2023 at 1:06pmI have imported F1 races with an ICS file.However there is no description in the ICS file for the events.I would really like to insert a default description for all the events, so that it is not so empty.Is there any way to achieve this easier than editing every single event to copy paste a description inside?Hope to hear from you!Thanks!Jeffrey 894Zhivko repliedJanuary 2, 2023 at 1:14pmHi,Place this filter in your theme or child-theme functions.php file: add_filter('stec_event_get_front_data', function($data) { if (!$data['description']) { $data['description'] = 'My generic description here'; } return $data;}); Stachethemes Developer 1seotijger repliedJanuary 2, 2023 at 1:36pmThank you very much, I'm going tot make a child theme and than add it to the functions file.Thanks! 1seotijger repliedJanuary 2, 2023 at 4:11pmThank you, the code works perfectly.Another question can I also make a default image for the event with such a piece of code?And why is there no date and time in the pop-up information? See screenshotAttached files: event-popup.png 894Zhivko repliedJanuary 3, 2023 at 4:20pmUpdated filter: add_filter('stec_event_get_front_data', function($data) { if (!$data['description']) { $data['description'] = 'My generic description here'; } if (!$data['images']) { $data['images'] = array(0); $data['images_meta'] = array( array( "id" => 0, "alt" => "", "caption" => "", "description" => "", "src" => "https://url-to-image", // fill this "thumb" => "https://url-to-image-thumb", // fill this "title" => "" ) ); } return $data;});The popup don't have date and time yes... I'll be updating the calendar this week and will make sure to add them. Stachethemes Developer Sign in to reply ...
I have imported F1 races with an ICS file.
However there is no description in the ICS file for the events.
I would really like to insert a default description for all the events, so that it is not so empty.
Is there any way to achieve this easier than editing every single event to copy paste a description inside?
Hope to hear from you!
Thanks!
Jeffrey
Hi,
Place this filter in your theme or child-theme functions.php file:
Stachethemes Developer
Thank you very much, I'm going tot make a child theme and than add it to the functions file.
Thanks!
Thank you, the code works perfectly.
Another question can I also make a default image for the event with such a piece of code?
And why is there no date and time in the pop-up information? See screenshot
Attached files: event-popup.png
Updated filter:
The popup don't have date and time yes... I'll be updating the calendar this week and will make sure to add them.
Stachethemes Developer