You are write, if you use the WP excerp I can’t cut the length.
A workaround is don’t use the excerp text and delete it. Than WP function the_excerpt() use the content text and with the content text the length filter works.
I’ll have to look or make a WP ticket … ;(
There are three different types show preview text: manual excerpt, automatic excerpt and the teaser when you use the More tag (http://codex.ww.wp.xz.cn/Excerpt).
– The length filter works only with automatic excerpt.
– If you manually added an excerpt, you’d want it all to be shown.
– When the post template uses the the_content() template tag, WP will look for the More tag.
https://ww.wp.xz.cn/support/topic/excerpt-length-doesnt-work
Thread Starter
pofex
(@pofex)
Hi,
thank you for your answer!
You can look here: http://wordpress.st-martin-leipzig.de/kita-st-martin/
Under the header “Test” I would like show the full articel. But only the header “Sommerfest in unserer Kindertagesstätte Sankt Martin” shows. If I activate the option “Show post excerpt”, than it’s show only few words (whatever I write in “Excerpt length”).
Thanks for look my site.
1.) Go to edit your post.
2.) Open WP screen options (https://en.support.wordpress.com/screen-options/).
3.) Check excerpt.
4.) Delete “Sommerfest in unserer Kindertagesstätte Sankt Martin” in the excerpt box!
5.) Now the Category Posts Widget shows the automatic excerpt form your post
6.) … and the option excerpt length have to work.
Thread Starter
pofex
(@pofex)
I’ve tried your manual.
The excerpt box is without some text. But if I write here and I activate the check-box in your plugin, than the text shows oin my site.
Authmatical excerpt doen’t function.
There is a option to show the full content of post?
Maybe it’s a progamaticaly setted filter to the the_excerpt() function. With automatical excerpt you can filter anything, like the length.
It must filter in your Theme. You use a Pro Theme (“Moesia Pro 2”). It’s not possible for me to take a code view:
In your function.php it’s a filter-function for the_excerpt() or somewhere else, like:
function the_excerpt_dynamic($length) { // Outputs an excerpt of variable length (in characters)
global $post;
$text = $post->post_exerpt;
if ( ” == $text ) {
$text = get_the_content(”);
$text = apply_filters(‘the_content’, $text);
$text = str_replace(‘]]>’, ‘]]>’, $text);
}
$text = strip_shortcodes( $text ); // optional, recommended
$text = strip_tags($text); // use ‘ $text = strip_tags($text,’<p><a>‘); ‘ to keep some formats; optional
$text = substr($text,0,$length).’ […]’;
echo apply_filters(‘the_excerpt’, $text);
}
?? (sorry)
Uses: apply_filters() for ‘the_excerpt’ (https://codex.ww.wp.xz.cn/Function_Reference/the_excerpt#Notes)
Can you ask the author of the Pro Theme? What’s wrong/the hint with the the_exerpt() from the Theme.