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

Custom Excerpts Per Page

Here’s a solution that should do what you want (per your questions in comments and chat): Functions.php function wpse102641_custom_excerpt_length( $length ) { // assuming your category is called “Stories” if ( is_category( ‘Stories’ ) ) { return 50; } // return default length return $length; } add_filter( ‘excerpt_length’, ‘wpse102641_custom_excerpt_length’, 999 ); References Codex: is_category()

Hide specific content from excerpts

Ok, I’ve found the answer myself through a lot of Googling 🙂 If anyone else is struggling, this pastebin provides a solid solution for stripping out headings from the excerpts. The solution was provided by Michael at the WordPress Support Forum.

How do I Add HTML to the_excerpt() & the_content() Output?

get_the_excerpt() returns the excerpt, but only after applying get_the_excerpt filters to it. This causes infinite recursion, as your filter handler will be called to an infinite depth. Of course, the best solution is the css one (see @spacegrrl’s answer), but if you have your reasons for keeping that <span>, please note that the excerpt can … Read more

Return only post(s) which have post_excerpt

Something along these lines should work, not tested for syntax errors though function random_post() { $args = array( ‘post_type’ => ‘post’, ‘orderby’ => ‘rand’, ‘posts_per_page’ => 1, ); $post = query_posts( $args ); } if(!$post->post_excerpt){ random_post(); } // Then down here you would do whatever with the $post object

Using get_the_excerpt() Before The Loop

So you are basically also looking for a fallback in case your excerpt is empty? I suppose this question/answer could be helpful for you: “get_the_excerpt() with fallback like the_excerpt()“. It describes, how to build your own “excerpt” in case there is none – like this: $excerpt = get_the_content(); $excerpt = esc_attr( strip_tags( stripslashes( $excerpt ) ) … Read more