Show two different sized featured images on homepage

With get_post_thumbnail() you have the ability to insert a featured image in your theme.
the_post_thumbnail( $size, $attr ); holds to parameter 1. The size of your image and the ID.

If you would like to have 2 image sizes of featured images on your home page you could do it like this:

if(is_front_page(){  // only on frontpage
 if ( has_post_thumbnail() ) { // check if the post has a Post Thumbnail assigned to it.
  the_post_thumbnail($post->ID, array(320,320));
 } 

}else if(is_page()){
  if ( has_post_thumbnail() ) {
      the_post_thumbnail($post->ID, array(120,120));
  }
}

Leave a Comment