Tag Info

New answers tagged

0

Plugin Here's a tiny plugin that allows you to override the Full-Text/Summary feed option, through a simple GET parameter: <?php /** * Plugin Name: Feeds with Summary Or Full Text * Description: GET parameter _summary with values yes or no * Plugin URI: http://wordpress.stackexchange.com/a/195197/26350 */ add_action( 'rss_tag_pre', function( $tag ...


0

With Wordpress 4.2.2 I'm using the following (admittedly fragile) method to search excerpts as well as the content and title without a plugin. This is the relevant snippet from functions.php. add_filter('posts_where', 'custom_posts_where'); function custom_posts_where($where) { if (is_search()) { $where = preg_replace( ...


1

You can wordpress excerpt using maximam character OR word count and display like Loriem ipsum[...] so I have solution. This code put in function.php /** * The Excerpt for word counting in the_content or excerpt. */ function getCharCut($text, $limit) { $char_cut=substr(strip_tags(stripslashes($text)),0,$limit); ...


2

You can achieve this by using the_excerpt filter. You can read further on the codex. Just paste this code in functions.php and set the value of $i = no of words from the end you want. add_filter('the_excerpt','my_excerpt'); function my_excerpt(){ global $post; $excerpt=get_the_excerpt(); $content = get_the_content(); ...


1

By default character length for excerpt is 55.Just use this code instead.For more details refer to codex function new_excerpt_more( $length ) { return 100; } add_filter( 'excerpt_length', 'new_excerpt_more', 999 );


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.


0

i think this may solve your problem by removing this condition if ( preg_match('/<!--more(.*?)?-->/', $post->post_content) ) { Not sure but give it a try Adds Read More after the excerpt. add_filter('the_excerpt','openstrap_excerpt'); function openstrap_excerpt(){ global $post; $link='<span class="readmore"><a ...


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



Top 50 recent answers are included