CodeHQ

Posts Tagged ‘Thumbnail’

|

Echo thumbnail URL and size | WordPress

Monday, October 24th, 2016

Use the PHP in the query below – and then the HTML example below to echo the URL out.

the_post_thumbnail_url();                  // without parameter -> 'post-thumbnail'
 
the_post_thumbnail_url( 'thumbnail' );       // Thumbnail (default 150px x 150px max)
the_post_thumbnail_url( 'medium' );          // Medium resolution (default 300px x 300px max)
the_post_thumbnail_url( 'large' );           // Large resolution (default 640px x 640px max)
the_post_thumbnail_url( 'full' );            // Full resolution (original size uploaded)
 
the_post_thumbnail_url( array(100, 100) );  // Other resolutions

Tags: , , , ,
Posted in PHP, WordPress | No Comments »

Using media gallery image sizes with ACF | WordPress

Friday, March 25th, 2016

You can use thumbnail, medium, large or full as the sizes variable to serve the size image you require.

<?php $image = get_field('the_image'); ?>
<img src="<?php echo $image['sizes']['thumbnail']; ?>" alt="<?php echo $image['caption']; ?>" />

Tags: , , , , , , ,
Posted in PHP, WordPress | No Comments »