how to change my child theme featured image dimensions?

First: why do you care the size of the thumbnail displayed in the “Featured Image” meta box on the Edit Post screen?

Second: that image size isn’t defined by Twenty Ten (or any other Theme). It’s defined by core, and is actually simply calling the original image size, and scaling it.

Edit

Whoops; that was wrong. 🙂 That Meta Box is apparently displaying the 'thumbnail' image size. (And I had forgotten that one of my primary beefs with Twenty Ten / Twenty Eleven is that they screw with the default thumbnail size.)

Start here:

<?php
set_post_thumbnail_size( HEADER_IMAGE_WIDTH, HEADER_IMAGE_HEIGHT, true );
?>

So, you were on the right track. 🙂

Next go to the define calls:

<?php
define( 'HEADER_IMAGE_WIDTH', apply_filters( 'twentyten_header_image_width', 940 ) );
define( 'HEADER_IMAGE_HEIGHT', apply_filters( 'twentyten_header_image_height', 198 ) );
?>

So, the easiest way to override those defined sizes is via the twentyten_header_image_width and twentyten_header_image_height filters. e.g., in your Child Theme’s functions.php file:

<?php
function wpse44268_filter_twentyten_header_image_width( $width ) {
    return '150';
}
add_filter( 'twentyten_header_image_width', 'wpse44268_filter_twentyten_header_image_width' );


function wpse44268_filter_twentyten_header_image_height( $height ) {
    return '150';
}
add_filter( 'twentyten_header_image_height', 'wpse44268_filter_twentyten_header_image_height' );
?>

These will define the post thumbnail as 150×150. Change the return values to suit your needs.

Leave a Comment