S
S
Sergey2015-11-19 15:27:45
WordPress
Sergey, 2015-11-19 15:27:45

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

2 answer(s)
V
Valera Udav, 2015-11-19
@ksv87

the_excerpt()
or in the visual editor, use the more tag in the right place
670px-Add-Read-More-to-Wordpress-Step-8.

M
Maxim Martirosov, 2015-11-19
@kalbac

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;
}

This code needs to be added to the functions.php file in your theme

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question