How to add “read more” button to the excerpt?
-
Hello!
The text in the excerpt of the event description in the list page gets cut off after 30 words and I would like to add some CTA button like “read more” or “…more” right after it or below maybe, because it is odd if the excerpt ends in the middle of a sentence and/or with an article (“a”/”the”), for example and there’s no clear button to open the single event page, it is not very obvious. ??
So far I only found the code to alter the number of the words that are shown in the excerpt which isn’t what I needed, but maybe it will help with a solution.
// Changes the excerpt length for events to 100 words
function custom_excerpt_length( $length ) {
if( tribe_is_event() && is_archive() ) {
return 100;
}
}
add_filter( ‘excerpt_length’, ‘custom_excerpt_length’, 999 );- This topic was modified 1 year, 6 months ago by .
- This topic was modified 1 year, 6 months ago by .
- This topic was modified 1 year, 6 months ago by .
The page I need help with: [log in to see the link]
- The topic ‘How to add “read more” button to the excerpt?’ is closed to new replies.