Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I need to change the post thumbnail size in my child theme. I have read several answers on how to do this in twenty twelve, which is very similar, but nothing is happening when I use similar code for my 2013 child theme. This is the only code I have in my functions.php file:

    function watercolor_setup() {        
        set_post_thumbnail_size( 604, 310, false );        
}

    add_action('after_setup_theme', 'watercolor_setup', 20);

I deleted the old images, regenerated the old images, but the new ones being created are using the 2013 size parameters and not the new ones set in my child theme.

I also tried this code - not to mention a few others - with and without the false:

if ( ! function_exists( 'watercolor_setup' ) ):

  function watercolor_setup() {
    if ( function_exists( 'add_theme_support' ) ) {
        add_theme_support( 'post-thumbnails' );
        set_post_thumbnail_size( 604, 310, false );
    }
  }
endif;

add_action('after_setup_theme', 'watercolor_setup', 20);

But, nothing is having any effect. What am I missing?

share|improve this question

1 Answer 1

The function that handles thumbnail size is already hooked with after_setup_theme in \twentythirteen\functions.php.

There is no use adding a if (!function_exists()) in child functions.php because the child functions.php is always loaded before. So this would be more logical to find this in the parent file.

The answer would be to set a different prority to your child function like :

add_action('after_setup_theme', 'watercolor_setup', 11);

But as you mentioned this does not work in your case. This makes me to perplex because it should override size. I guess you'll have to code it in each template you want to modify in your child theme:

the_post_thumbnail(array(604,310));
share|improve this answer
    
Thank you JMa. I think the problem might not be the code in that function after all. I added another function and it is not working either, so while my styless.css file is working for the child theme, it doesn't seem to be seeing the functions.php file. I'll open another thread for that. –  user1388610 Aug 12 '13 at 7:24
    
I found that my problem was a typo. I had looked at the code very carefully and was sure that there was no typo in the code. I was right, the typo was in the filename. I spelled functions wrong! –  user1388610 Aug 13 '13 at 3:37

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.