N
N
Nikita Roisman2021-09-22 23:42:08
WordPress
Nikita Roisman, 2021-09-22 23:42:08

How to show the post announcement on the main page?

Hello.
WordPress Twenty Fifteen Theme:
I can't announce a post on the main and headings.
By default, the topic is configured as follows: all posts are shown in full.

I changed the value of the_content to the_excerpt in the content.php file, almost done, but when you go to the post page, everything remains the same - “read more”.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Artem Zolin, 2021-09-24
@Kropers

It is possible like this:

if ( is_single() ) {
  the_content();
} else {
  the_excerpt();
}

It is advisable to create a child theme, copy the content.php file into it and make changes to it so that the changes are not overwritten when the theme is updated

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question