Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #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: 1105

    if( ( $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);

    #1488222

    Hey 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,
    Ismael

    #1488233

    It 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?

    #1488239

    Hi,

    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ünter

    #1488240

    Great, thanks!

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.