Answer the question
In order to leave comments, you need to log in
Wordpress how to make it so that not the full text of the article is displayed on the main page, but the announcement?
wordpress how to make it so that not the full text of the article is displayed on the main page, but the announcement
Answer the question
In order to leave comments, you need to log in
the_excerpt()
or in the visual editor, use the more tag in the right place
add_filter( 'the_content', 'content_on_home_page');
function content_on_home_page( $content ) {
if( ( is_home() || is_front_page() ) && in_the_loop() ) {
$content = wp_trim_words( $content, 55 );
}
return $content;
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question