How to automatically display a photo header of an article?

Hello

How to automatically display a photo header of an article ?
For example, as the article below:

Thanks

Hi!

In your screenshot the image in the article is inserted manually, at the beginning of the post.

Do you want to have the Featured Image appearing automatically above the title?

If so, then you will have to create a Child Theme first

After that copy the file “content-single.php” in your Child Theme.

Then edit the file using the Theme Editor, and after this line:

<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>

add the following code:

<?php if ( has_post_thumbnail() ) : ?>

    <div class="post-thumb"><?php the_post_thumbnail('large'); ?> </div>

<?php endif; ?>

That’s all, now the image will appear automatically in all posts.

1 Like

Thank you very much, it is work fine ! Thanks