How to add post thumbnail on posts on sites homepage?

I am using 2017 theme and I want to thumbnail to the posts which appears on my site homepage, thumbnail appearing when we visit post but doesn't appear on homepage

Topic theme-twenty-seventeen post-thumbnails homepage Wordpress

Category Web


This plugin has an option that fixes this problem without needing a child theme https://wordpress.org/plugins/options-for-twenty-seventeen/


The best way is to create a child theme so that when changes are made to 2017 theme and you update your theme with repository, your changes are not lost.

How to create a child theme

Then go to the theme folder/template-parts/post/content.php

Approx edit line 54 to add native function get_the_post_thumbnail(); to div.entry-content

below is the code

<div class="entry-content">
        <?php
        get_the_post_thumbnail();
        /* translators: %s: Name of current post */
        the_content( sprintf(
            __( 'Continue reading<span class="screen-reader-text"> "%s"</span>', 'twentyseventeen' ),
            get_the_title()
        ) );

        wp_link_pages( array(
            'before'      => '<div class="page-links">' . __( 'Pages:', 'twentyseventeen' ),
            'after'       => '</div>',
            'link_before' => '<span class="page-number">',
            'link_after'  => '</span>',
        ) );
        ?>
    </div><!-- .entry-content -->

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.