Could someone help me to trim the blog articles and place a read more link? Because the whole article shows up at the blog page now. I know I can use the read more tag, but I have more than 100 articles so isn’t there a way to integrate a function instead of placing a read more tag in every article?
Please open up /includes/loop-index.php and find line 34 that looks like
$current_post['content'] = get_the_content(__('Read more','avia_framework').'<span class="more-link-arrow"> →</span>');
and change it to look like
$current_post['content'] = wp_trim_words( get_the_content(), 21, ' <a href="'. get_permalink() .'">'.__('Read more','avia_framework').'</a>...' );
In the above code, 21, is the number of words before the Read More link is added, you can change that number to any number of words that suits you best. You can also change ”Read more” if you want , to something else, just leave the quotes and all the other stuff as is.
The topic ‘Trim Blog page’ is closed to new replies.