I am trying to display the featured images of certain pages of my website on my homepage, which I want to call by page id. I can figure out how to do this for my recent posts, etc., but I want to call the featured images from only a few of my pages (not posts).
I’ve tried fiddling with the following for a while, but I can’t seem to get it to work:
<?php $page_id = 144; $my_page = get_page( $page_id ); if( $my_page ) foreach( $my_page as $my_post ) : setup_postdata( $my_post ); the_post_thumbnail('full'); endforeach; wp_reset_query(); ?>
- The topic ‘Posting featured images by page id’ is closed to new replies.