Tagged: blog post excerpts
-
AuthorPosts
-
July 21, 2020 at 10:05 pm #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.
July 22, 2020 at 4:36 pm #1232308Hey 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,
VictoriaJuly 23, 2020 at 8:36 pm #1232799Thanks 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.
July 27, 2020 at 2:56 pm #1233524Hi,
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,
IsmaelJanuary 21, 2021 at 3:00 am #1274252I 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.
January 21, 2021 at 4:17 pm #1274424Hi 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 -
AuthorPosts
- You must be logged in to reply to this topic.