You’re not inside a regular loop, or at least not one where global post variables are set, so the_post_thumbnail
does not have an ID to fetch a thumbnail for..
Use get_the_post_thumbnai( $page->ID )
instead and it should work fine.
You’re not inside a regular loop, or at least not one where global post variables are set, so the_post_thumbnail
does not have an ID to fetch a thumbnail for..
Use get_the_post_thumbnai( $page->ID )
instead and it should work fine.