Answer the question
In order to leave comments, you need to log in
If the news has a picture, then set a different style for the news?
How to set a different style for the news block if the news block has an image? Let's say we add news to the site through Wordpress without a picture, then just a title is displayed, a short description below, and a link to the full news. And if with a picture, then the title should be on top of the picture, a brief description below (behind the picture).
Answer the question
In order to leave comments, you need to log in
By picture, you probably mean thumbnail.
In your theme's loop.php file, change the theme's output
if ( has_post_thumbnail() ) {
the_post_thumbnail();
//здесь выводим в нужном формате, если есть thumbnail
}
else {
//здесь выводим в нужном формате, если нет thumbnail
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question