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

    I found 3 other threads in here on how to shorten blog post excerpt, but none of the solutions worked for me.

    See https://theheclub.com/homeless-celebrities/ and let me know what I need to do to shorten the excerpts.

    Whether a user adds 100 words or 500 words, I want the max shown to be 20 words.

    Thank you.

    #1232308

    Hey WebDevDept,

    Here is the code you can put in your funtions.php

    
    add_filter('avf_postgrid_excerpt_length','avia_change_postgrid_excerpt_length', 10, 1);
    function avia_change_postgrid_excerpt_length($length)
    {
       $length = 20;
       return $length;
    }
    

    If you need further assistance please let us know.

    Best regards,
    Victoria

    #1232799

    Thanks Victoria but no go so far even after clearing cache and viewing from another browser.

    See screenshot here https://theheclub.com/ojidaric/2020/07/789067890.png and let me know if I’ve added it correctly?

    Thank you.

    #1233524

    Hi,

    Thank you for the update.

    The site is not loading on our end because of SSL issues. Please ask your hosting provider to configure the SSL certificates so that the site can be accessed properly.

    If you’re not using the grid layout, try to use this function instead to limit the number of characters in the excerpt.

    add_filter( 'excerpt_length', function($length) {
        return 20;
    } );
    

    Best regards,
    Ismael

    #1274252

    I have tried every solution you have offered, but I primarily am using masonry grid displays, and I cannot change the post excerpt length, not matter what I do. Any advice would be welcomed.

    #1274424

    Hi BlewWeb,

    You need a different filter, please try the solution posted here:

    Or this snippet here:

    
    add_filter('avf_masonry_loop_prepare','avia_change_default_link', 10, 2);
    function avia_change_default_link($loop, $entries)
    {
    	foreach($entries->posts as $key => $entry)
        {
            if($entry->post_type == "post")
            {
                $more 	 		 =  "<br /><span class='masonry-more-link-arrow'>".__('Read more','avia_framework')."</span>";
    			$loop['content'] =   avia_backend_truncate($entry->post_excerpt, apply_filters( 'avf_masonry_excerpt_length' , 100) , apply_filters( 'avf_masonry_excerpt_delimiter' , " "), "…", true, '') . $more;
            }
        }
    
        return $loop;
    }
    

    Best regards,
    Victoria

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