Not too long ago I wanted to know how to cut off excerpts (on a blog page by using the blog posts element of the builder) at the read more tag, instead of using a certain amount of characters/words for cutting them off:
– https://kriesi.at/support/topic/cut-excerpt-off-at-more-tag-instead-of-using-wordcharacter-count/
The solution worked great. I added this code to my childs function.php file:
add_filter( 'post-format-standard', 'avia_category_content_filter', 15, 1);
function avia_category_content_filter($current_post)
{
if(!is_single())
{
global $more;
$more = 0;
$current_post['content'] = get_the_content(__('Read more','avia_framework').'<span class="more-link-arrow"> →</span>');
}
return $current_post;
}
Just wanted to let you guys know this does only work for standard post types; for example, it doesn’t work for image post types. So I had to change the code a bit, and by trial and error I found out it should be someting like this (note the second line):
add_filter( 'post-format-standard', 'avia_category_content_filter', 15, 1);
add_filter( 'post-format-image', 'avia_category_content_filter', 15, 1);
function avia_category_content_filter($current_post)
{
if(!is_single())
{
global $more;
$more = 0;
$current_post['content'] = get_the_content(__('Read more','avia_framework').'<span class="more-link-arrow"> →</span>');
}
return $current_post;
}
Just wanted to let you know, as well wondering if there’s a general/better code to assign the filter to all post types…