excerpt_length not working

The are two quick ways to display custom excerpt lengths in your theme using wp_trim_words. Remember, if you use the_excerpt(), your excerpt length will always be a maximum of 55, never more. If you use the_content() on the other hand, you can specify an excerpt length of more than 55 words. Use the following to … Read more

the_excerpt Read More Filter

Just add the filter where you need it. Define the filter callback in functions.php but don’t add the filter… // Changing excerpt more function new_excerpt_more($post) { return ‘ <a class=”read_more” href=”‘. get_permalink($post->ID) . ‘”>’ . ‘read more’ . ‘</a>’; } In your template file just before you need the custom more link: add_filter(‘excerpt_more’, ‘new_excerpt_more’); And … Read more

How to remove “Read on” content in the_excerpt?

If you’re using the Twenty Eleven theme I think you need to remove that theme’s filter before you can define your own: remove_filter( ‘excerpt_more’, ‘twentyeleven_auto_excerpt_more’ ); edit building from t-p try this: add_action( ‘after_setup_theme’, ‘my_child_theme_setup’ ); function my_child_theme_setup() { remove_filter( ‘excerpt_more’, ‘twentyten_auto_excerpt_more’ ); } In case you are using twentyeleven, use “twentyeleven_auto_excerpt_more” instead of ‘twentyten_auto_excerpt_more’

How do I disable excerpts on blogs and website

You need to call remove_post_type_support() in your functions.php like that: /** * Remove unwanted features. */ add_action(‘init’, ‘my_theme_remove_post_type_support’); function my_theme_remove_post_type_support() { remove_post_type_support(‘post’, ‘excerpt’); }

“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

Disable WYSIWYG rich text editor only on post excerpt

Excerpts can be automatically generated in which case you have some control over them or manually generated in which case there is very little control available, and the wordpress way is that they may have any type of content. if you need something more restrictive you will need to create your own “meta box” for … Read more

Custom Excerpt is returning 52 characters and not 52 words

The function you want is wp_trim_words(), example: function themeTemplate_trim_excerpt( $content ) { $more=”…”; //where $more is optional return wp_trim_words($content, 52, $more); } remove_filter(‘get_the_excerpt’, ‘wp_trim_excerpt’); add_filter(‘get_the_excerpt’, ‘template_trim_excerpt’);

Modify Twenty Fourteen Home Page Content Limit & Add Read More Link

The twentyfourteen index page calls get_template_part( ‘content’, get_post_format() ); inside the loop. So the content of the loop resides in template files with the name content-{$post_format}.php. All posts that does not have a post format uses content.php to display the post data If you look at content.php, these lines are where the content is retrieved … Read more

Spacing within the excerpt

The excerpt stips all html tags, a feature that frustrates many. I have written a custom excerpt that stops the excerpt from stipping any html tags. It also breaks the excerpt after the sentence after the set amount of words. If you need to cut the excerpt at exact words, you will just need to … Read more

Excerpts that don’t truncate words

Set the filter dynamically based on the page you are loading. If category archive pages have a 100 word excerpt, but posts have a 10 word excerpt, and everything else uses the default: function my_custom_excerpt_length( $orig ) { if( is_category() ) { return 100; } elseif( is_single() ) { return 10; } return $orig; } … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)