admin管理员组文章数量:1332389
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
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
Share Improve this question edited Nov 5, 2017 at 13:59 fuxia♦ 107k38 gold badges255 silver badges459 bronze badges asked Nov 5, 2017 at 11:46 Rahul PalveRahul Palve 33 bronze badges2 Answers
Reset to default 0The 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 -->
This plugin has an option that fixes this problem without needing a child theme https://wordpress/plugins/options-for-twenty-seventeen/
本文标签: How to add post thumbnail on posts on sites homepage
版权声明:本文标题:How to add post thumbnail on posts on sites homepage? 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742291802a2447940.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论