Tagged: description, excerpt, Upcoming events
Hi there,
I was wondering if you could tell me how to add an except or description of the upcoming events underneath the title of each event. Is there also a way stop the featured images from uploading at a 180px by 180px dimension in the thumbnail?
Thank you!
Hey dialedinmarketing!
Thank you for using Enfold.
You need to modify the config-templatebuilder > avia-shortcodes > events_upcoming.php file if you want to add a description or excerpt. Look for this code around line 150:
$output .= apply_filters('avf_upcoming_event_extra_data', "", $entry);
Below, you can add the excerpt code. Refer to this link for more info:
https://codex.wordpress.org/Function_Reference/get_the_excerpt
https://codex.wordpress.org/Function_Reference/get_the_content
Regarding the thumbnail, add this in the functions.php file:
add_action( 'after_setup_theme', 'ava_image_sizes', 11 );
function ava_image_sizes() {
add_image_size('square', 845, 321, array('center', 'top'));
}
Adjust the width (845) and height (321) value. Regenerate or upload the images after.
Best regards,
Ismael
Hi Ismael,
Thanks for the response.
Unfortunately, I’m not that well versed in php. Would you be able to tell me exactly what to add below line 150 to just get the excerpt of the event?
Your instructions in regards to the thumbnail sizing works great!
Hey!
Add this below the code we mentioned on the previous post:
$excerpt = $entry->post_excerpt;
$output .= "<span class='av-upcoming-event-excerpt'>{$excerpt}</span>";
Make sure that you add a summary in the events’ excerpt box. Replace post_excerpt with post_content if you want to show the event’s whole content.
Best regards,
Ismael
Perfect!
Thank you, Ismael.