How to remove first three words from content and display the excerpt

Here’s a quick way to do it, assuming $excerpt has your excerpt you want to remove the first 3 words from $excerpt = “the content starts this is the excerpt”; $words = explode(‘ ‘, $excerpt); array_shift($words); // 1st word array_shift($words); // 2nd word array_shift($words); // 3rd word $excerpt = implode(‘ ‘, $words); It splits the … Read more

Excerpt_length nor the_excerpt not working correctly

the_excerpt() … Displays the excerpt of the current post after applying several filters to it including auto-p formatting which turns double line-breaks into HTML paragraphs. It uses get_the_excerpt() to first generate a trimmed-down version of the full post content should there not be an explicit excerpt for the post. get_the_excerpt() applies the get_the_excerpt filter, to … Read more

Bug in the_excerpt() function

You can wrap your output in the has_excerpt function, this checks if the post has a custom excerpt. if (!function_exists(‘sociality_excerpt_more’)) { function sociality_excerpt_more($more) { if ( has_excerpt() ) { return $more . ‘&nbsp<a class=”read-more p-color” rel=”bookmark” title=”‘. get_the_title() .'” href=”‘. get_permalink($post->ID) . ‘”>’. esc_html__(‘View more’,’g5plus-handmade’) .'<i class=”pe-7s-right-arrow”></i></a>’; } else { return $more; } } add_filter(‘the_excerpt’, … Read more

Excerpt using Read More Tag

You just need to set the first argument of the_content() to an empty string: <?php the_content( ” ); ?> If you don’t pass an argument it will use the default, which is a link with the text “(more…)”, but by passing an empty string, the empty string (i.e. nothing) gets displayed instead. If you want … Read more

Excerpts automatically remove paragraph space

Looks like my other answer wasn’t working, so I looked into it and found this: http://aaronrussell.co.uk/legacy/improving-wordpress-the_excerpt/ That article should give you all you need to keep the <p> tags in there.

Include post title in readmore link?

If the following code is in-fact the code that is controlling your read more link then you perhaps the following may work; if ($show_more_tag) { global $post; $excerpt = $excerpt . ‘ <a class=”more-link” href=”‘ . $perma_link . ‘”>’ . get_the_title($post->ID) . ‘ </a>’; } I’ve declared global $post; again, just in case the above … Read more