Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #331192

    I am using two Blog Post content elements right next to each other, set in two columns at two different widths. It looks like the “Single Author, Big Preview Pic” has an excerpt length of 55, while the “SIngle Author, Small Preview Pic” has an excerpt length of 63. I would like to shorten these elements. I have tried the following with no luck:

    add_filter(‘avf_postgrid_excerpt_length’,’avf_increase_postgrid_excerpt_length’, 10, 1);
    function avf_increase_postgrid_excerpt_length($prepare_excerpt) { return 40; }

    Does the content inside the ” need to change?

    #332062

    Hi!

    Try with this code instead:

    function custom_excerpt_length( $length ) {
       return 30;
    }
    add_filter( ‘excerpt_length’, ‘custom_excerpt_length’, 999 );
    

    Cheers!
    Josue

    #333429

    Hmm… that’s not working either.

    How is the homepage (using Blog Posts: Grid Layout,showing Title and Excerpt) only showing 9 words, but the Insights page (using Blog Posts: Single Author, showing small preview pic w/excerpt) showing 62 words?

    #333457

    Hi,

    Can you please create us a WordPress administrator account? post it here as a private reply.

    Regards,
    Josue

    #333492
    This reply has been marked as private.
    #333574

    Hi!

    Check out your homepage, excerpt is longer now. I left these two codes in your child functions.php so you can adjust both excerpts as needed:

    /* Modify excerpt length (grid) */
    function avf_increase_postgrid_excerpt_length() { 
    	return 140;
    }
    add_filter('avf_postgrid_excerpt_length','avf_increase_postgrid_excerpt_length', 10);
    
    /* Modify excerpt length (not grid) */
    function custom_excerpt_length( $length ) {
       return 140;
    }
    add_filter('excerpt_length', 'custom_excerpt_length', 999 );
    

    You can also merge them into one single function:

    /* Modify excerpt length (global) */
    function custom_excerpt_length( $length ) {
       return 140;
    }
    add_filter('excerpt_length', 'custom_excerpt_length', 999 );
    add_filter('avf_postgrid_excerpt_length','custom_excerpt_length', 10);
    
    

    Cheers!
    Josue

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