Read More for Excerpt not working

You can modify the […] with simple function you place in functions.php function wpdocs_excerpt_more( $more ) { return ‘<a href=”‘.get_permalink( get_the_ID() ).'”>[…]</a>’; } add_filter( ‘excerpt_more’, ‘wpdocs_excerpt_more’ );

Custom excerpt legnths for specific pages

The excerpt length is the number of words, not the characters. Assuming that every word is 8 characters long in average, you might want to use this: function wpdocs_custom_excerpt_length( $length ) { if( is_front_page() ){ return 50; } else { return 100; } } add_filter( ‘excerpt_length’, ‘wpdocs_custom_excerpt_length’, 999 ); Source : WordPress codex

Remove ellipsis from the excerpt retrieved using get_the_excerpt()

The third field in add_filter() is priority. Default WP hook priority is 10. You can omit the 1 altogether, or still declare number of arguments accepting by function by passing it as 4th field. add_filter(‘excerpt_more’, ‘change_excerpt_more’, 10, 1); OR for default: add_filter(‘excerpt_more’, ‘change_excerpt_more’); re: questions in comments still wondering why it wouldn’t work without having … Read more

How to display only the excerpt in the blog/posts page with Gutenberg?

You should use a custom page for this. For reference, we can modify the default (twentynineteen) post content block. Depending on your theme, you may need to modify single.php, or a content block included from there. In the twentynineteen theme, we can see this on line 24: get_template_part( ‘template-parts/content/content’, ‘single’ ); Following that, we can … Read more

How to get excerpt correctly formatted

wp_trim_excerpt() calls wp_trim_words() which applies wp_strip_all_tags() to the excerpt. The <br> tag is removed and not replaced with anything. Not sure if this is feasible, but having a space after a colon is grammatically correct, and adding it to the original content would not affect the HTML, e.g.: <p>My new question is: <br>why words are … Read more

The excerpt: Display text OR image OR video

I would encourage you to consider using post formats. You can see my answer to a similar question about altering the “Read More” text, but it would apply similarly to you. For the video portion, you might want to create a custom field to hold the video URL, but otherwise, I imagine this would be … Read more

Different ‘read more’ links

How about using condition to change the readmore links. Here is an sample code which returns a different read more text based upon the category of post. You should read the official codex page to know more about other conditional tags you can use in wordpress. Usage – put this code into your theme’s functions.php … Read more

Change behavior depending on content length

We need two functions in the theme’s functions.php: One function checking the length of the content to adjust the title. Another one to print the formatted post content in case the first function returns TRUE. Let’s start with the first function. This is rather simple because we solved that already. 🙂 if ( ! function_exists( … Read more