0

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 homepageenter image description here

2 Answers 2

0

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 -->
6
  • Is this the default Wordpress twenty seventeen theme?
    – omukiguy
    Commented Nov 6, 2017 at 13:14
  • Could you a link if it is live on a server?
    – omukiguy
    Commented Nov 6, 2017 at 13:14
  • rahulpalve.ml Commented Nov 6, 2017 at 14:12
  • I am using advance twenty seventeen plug-in to use features of child theme Commented Nov 6, 2017 at 14:52
  • Just add <?php echo wp_get_attachment_url( get_post_thumbnail_id( get_the_ID() ) ); ?> to your code markup code <header class="entry-header"> <img src="<?php echo wp_get_attachment_url( get_post_thumbnail_id( get_the_ID() ) ); ?>"> </header>
    – omukiguy
    Commented Nov 7, 2017 at 9:46
0

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.