getchaos
(Michael)
6
Es gibt mittlerweile einen ganz guten Work-Around, den jemand im Elementor Git gepostet hat:
Das hier in der functions.php hinzufügen:
function summary($content, $limit = 200) {
$content = strip_tags($content);
// Take the existing content and return a subset of it
$end = '';
if (strlen($content) > $limit) {
$end = '...';
}
return substr($content, 0, $limit) . $end;
}
add_action( 'elementor_pro/posts/query/custom_excerpt', function( $query ) {
function trimTitle( $text, $id = null ) {
return summary($text,80);
}
function trimExcerpt( $text, $id = null ) {
return wpautop(summary($text,110));
}
add_filter( 'the_title', 'trimTitle', 10, 2 );
add_filter( 'the_excerpt', 'trimExcerpt', 10, 2 );
} );
Und anschließend im Widget von Elementor im Tab Layout bei der Query-ID „custom_excerpt“ angeben.
Es werden der Titel auf 80 Zeichen und das Excerpt auf 110 Zeichen getrimmt…kann man natürlich nach belieben in dem Code-Schnipsel anpassen.
Vielleicht hilft das ja dem ein oder anderem.