Add a pages featured image to a foreach loop

前端 未结 1 817
暗喜
暗喜 2021-01-26 17:35

I\'ve got a foreach loop that is displaying a list of subpages Title, Content and URL. I can\'t seem to display the featured image though! Here\'s what I have:

&         


        
相关标签:
1条回答
  • 2021-01-26 18:19

    you must use

    <?php echo get_the_post_thumbnail($pageChild->ID ); ?> 
    

    to get the post thumbnail as well page

    0 讨论(0)
提交回复
热议问题