Tag Info

New answers tagged

0

I use the Post Teaser plugin on my site. Just install and set how many words you want to show on the page; a link underneath opens the full post.


-1

I had a similar problem and solved it by: disabling the readmore link add_filter( 'the_content_more_link', 'modify_read_more_link' ); function modify_read_more_link() { return ''; } adding the link in the template echo '<a class="more-link" href="' . get_permalink() . '">Read more...';


1

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, ...


0

Found a solution which is working. Splitting the array like above just gives you the plain text so shortcodes wont work. this works: global $post; $content = get_extended( $post->post_content ); //get the_content $excerpt = $content['main']; //get the teaser part before more tag $main_content = apply_filters('the_content', $content['extended']); //get ...



Top 50 recent answers are included