WordPress Post Thumbnail with different sizes


<?php

//Post thumbnail sizes

$image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), array(316, 140) );

$image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), ‘large’ );

$image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), ‘medium’ );

$image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), ‘thumbnail’ );

$image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), ‘full’ );

echo $image[0];

//Woo-commerce images
the_post_thumbnail( ‘shop_thumbnail’ ); // Shop thumbnail (180 x 180 hard cropped)
the_post_thumbnail( ‘shop_catalog’ ); // Shop catalog (300 x 300 hard cropped)
the_post_thumbnail( ‘shop_single’ ); // Shop single (600 x 600 hard cropped)

Advertisement

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s