“Read more” link doesn’t show up when the post length is under the excerpt length

The reason is the following check in the wp_trim_words() function: if ( count( $words_array ) > $num_words ) { array_pop( $words_array ); $text = implode( $sep, $words_array ); $text = $text . $more; } else { $text = implode( $sep, $words_array ); } You can therefore try the following: add_filter( ‘wp_trim_words’, function( $text, $num_words, $more … Read more

Modify the_content after the more tag

I think you can use the get_extended( $post ) function; that returns an array with different parts of the content. See this example which works inside the Loop: $content_arr = get_extended( get_the_content() ); var_dump( $content_arr ); echo $content_arr[‘main’]; //Display the part before the more tag

Word limit in post_content after more tag

Use wp_trim_words function to limit the content to a certain number of words and returns the trimmed text. Example use of wp_trim_words function. <?php $content = get_the_content(); $trimmed_content = wp_trim_words( $content, 50, NULL ); echo $trimmed_content; ?> So I added wp_trim_words function in your code to get 50 words after <!– more –>. <?php $after_more … Read more

Ignore a more tag when using get_the_content()

I would just get the raw content from $post->post_content, strip the <!–more–> and then do whatever you need with the result. Just remember, $post->post_content and get_the_content() both return unfiltered text, if you need filtered content, simply apply the the_content filter to the result from those two results EXAMPLE inside the LOOP global $post; $unfiltered_content = … Read more

not functioning

I see several things that may be contributing to your issue. First, you’re using a custom page template to display the blog posts index, instead of using home.php as specified by the Template Hierarchy. That might be a problem, because the <!–more–> tag doesn’t work on singular pages, and since you’re doing funky things with … Read more

Style the text before in single.php

using: http://codex.wordpress.org/Function_Reference/the_content#Overriding_Archive.2FSingle_Page_Behavior and the $strip_teaser parameter: http://codex.wordpress.org/Function_Reference/the_content#Usage in single.php, replace <?php the_content(); ?> with: <?php if( strpos(get_the_content(), ‘<span id=”more-‘) ) : ?> <div class=”before-more”> <?php global $more; $more=0; the_content(”); $more=1; ?> </div> <?php endif; ?> <?php the_content(”, true); ?>

Read more tag shows up on EVERY post

I actually never got to add this section to my answer you are referring to. To remove the read more link from the excerpt is quite easy, you just need to compare $count with $excerpt_length. $count will always be between 0 and the value assigned to $excerpt_length. So what we want to do here is … Read more

Modify ‘Read more’ link adding a new class

What (exactly) happens When calling the_content() inside your template, you are able to call it without any parameters. This means, that the function already has the defaults of null for both arguments: The “more” link text and the boolean switch that allows you to strip teaser content before the “more” link text. The the_content() function … Read more