0
votes

I am trying to set a custom post thumbnail size in Wordpress. I have followed the documentation, which is pretty simple. But somehow the image is always set to some default size.

In functions.php

add_theme_support('post-thumbnails');
add_image_size('a',453,103);

When I print with the_post_thumbnail('a'); the post thumbnails will have the height 103 (correct) and width 100 (wrong). Why is the width ignored?

2

2 Answers

0
votes

add_image_size has a fourth argument, $crop. If set to true (hard crop), it'll force your images to be the exact size you specified. See the Codex.

0
votes

Just add ,'' after 103 to leave THE last argument as null