I want to add a custom image size to my child theme.
The base is the Penscratch theme, and it has it own image sizes defined:
function penscratch_setup() {
/* ... */
add_theme_support( 'post-thumbnails' );
add_image_size( 'penscratch-featured', '400', '200', true );
/* ... */
}
And if I made some changes here (base functions.php), everything work as it should, But the point is to make it done in child-Theme, I'm writing it the same way but for some reason it's not working:
add_action( 'after_setup_teme', 'add_custom_img_sizes');
function add_custom_img_sizes()
{
add_theme_support( 'post-thumbnails' );
add_image_size( 'category-thumbnail', '300', '200', true );
}
if I use then the 'category-thumbnail' in my template, it is displaying the full-sized image, not the cropped one, what is going wrong here?
h
intheme
). You may also need to select the desired image size where you display the image in your template - normally you'd use something likethe_post_thumbnail()
to do so, however the "category-thumbnail" you mention isn't a part of WordPress core. You may need to address your question to the respective theme or plugin author.