0
votes

this is my php code and i want to add the size thumbnail max 300x420

<a class="blog-views" href="<?php the_permalink(); ?>"><?php
the_post_thumbnail('full'); ?></a>

i have get from wordpress this code, but this do not help me, thumbnail, medium, mdeium large, large and full.

the_post_thumbnail( 'thumbnail' );     // Thumbnail (150 x 150 hard cropped)
the_post_thumbnail( 'medium' );        // Medium resolution (300 x 300 max height 300px)
the_post_thumbnail( 'medium_large' );  // Medium Large (added in WP 4.4) resolution (768 x 0 infinite height)
the_post_thumbnail( 'large' );         // Large resolution (1024 x 1024 max height 1024px)
the_post_thumbnail( 'full' );          // Full resolution (original size uploaded)
3
why not just use the_post_thumbnail('medium') ? Or do you need exactly 300x420 px? - wayneOS
i want exactly 300x420, i dot know what i need to put or maybe i can change it with css, i have try but is not working, so i want to make this with 300x420 so in my home page the latest post is coming same thumbnails size - user9576028

3 Answers

1
votes

Try to use this code:

the_post_thumbnail( array(300,420) );
1
votes

You can use set_post_thumbnail_size( 300, 420, true );

For more information follow this link set_post_thumbnail_size

1
votes

You can change thumbnail size from admin side, wp-admin/options-media.php