
Tagged: archive, bug, category page, date
-
AuthorPosts
-
August 18, 2025 at 8:53 am #1488170
On a category archive page, where the postslider is used, the display of the date is not consistent. I figured out it has to do with the excerpt.
In:
/wp-content/themes/enfold/config-templatebuilder/avia-shortcodes/postslider/postslider.php: 1105if( ( $show_meta && ! empty( $excerpt ) ) || in_array( $show_meta_data_post, array( 'always', 'on_empty_content' ) ) )
The excerpt sometimes seems empty, but is not. The excerpt sometimes only consist of spaces or newlines. Result: the date on some posts is displayed even if it shouldn’t.
A small fix for a next update should to trim the excerpt:
$excerpt = trim($excerpt);
August 19, 2025 at 4:06 am #1488222Hey roelvanleuken,
Thank you for the inquiry.
What happens when you add this filter in the functions.php file?
function avf_postslider_posts_meta_data_mod(){ return ''; } add_filter('avf_postslider_posts_meta_data', 'avf_postslider_posts_meta_data_mod'); function avf_post_slider_entry_excerpt_mod($excp, $prep, $perm, $entry) { return ''; } add_filter('avf_post_slider_entry_excerpt', 'avf_post_slider_entry_excerpt_mod', 10, 4);
This modifies the excerpt and returns it as an empty string.
Best regards,
IsmaelAugust 19, 2025 at 8:18 am #1488233It does nothing, when var_dumping $excerpt just before the if statement (line 1104), it still shows an empty string (with 4 or 8 characters) even with the filters applied.
I fixed it, for now, by adding:
add_filter( 'avf_postslider_posts_meta_data', function($show) { return 'always'; } );
But adding
$excerpt = trim($excerpt);
to the postslider seems to be the real fix?August 19, 2025 at 10:10 am #1488239Hi,
Thanks for bringing this up.
For next release I replaced line 889:
$trimmed_excerpt = trim( $entry->post_excerpt ); $prepare_excerpt = ! empty( $trimmed_excerpt ) ? $trimmed_excerpt : avia_backend_truncate( $entry->post_content, apply_filters( 'avf_postgrid_excerpt_length', $excerpt_length ), apply_filters( 'avf_postgrid_excerpt_delimiter', ' ' ), '…', true, '' );
I think this should fix the problem with excerpt containing whitespace characters only.
Best regards,
GünterAugust 19, 2025 at 10:20 am #1488240Great, thanks!
-
AuthorPosts
- You must be logged in to reply to this topic.