• I want to include thumbnails to my theme
    (which does not have featured images at the beginning of the posts)

    So I added <?php the_post_thumbnail( $size, $attr ); ?> and it works, but now I am trying to figure out how to resize it. So that every featured image thumbnail is a certain size and cropped by default.

Viewing 1 replies (of 1 total)
  • If you want to use a custom size, you have to add it in your theme’s functions.php, like this:

    add_image_size( 'custom-size', 220, 180, true );

    Then you change your the_post_thumbnail entry to include the name of your custom size in place of the $size variable:

    <?php the_post_thumbnail ('custom-size'); ?>

Viewing 1 replies (of 1 total)
  • The topic ‘resize thumbnails’ is closed to new replies.