Support » Theme: Twenty Twelve » Changing widths to allow pictures to be 640 pixels wide

  • Is there a way to change to width of the side menus to enable pictures to be inserted into the blog page so that they are 640 pixels wide?

    At the moment the maximum width of picture that can be displayed is about 624 / 625 pixels wide. I have migrated from the Twenty Ten theme which allowed pictures of 640 pixels wide (which I prefer).

    I guess if it’s possible to narrow the side menus by 16 pixels then this would be possible???

    I’m a complete novice at WordPress, so if this is possible can it be explained in “Idiot Proof” terminology?

    My blog page is at the following link ->

    Many thanks in advance for any help that can be provided.



Viewing 2 replies - 1 through 2 (of 2 total)
  • There are 2 things to do.

    .site-content {width: 65.104166667%;}

    set_post_thumbnail_size( 624, 9999 );

    First part is easy, second part is not really easy.

    The first part:

    You can just redeclare that value in your child theme’s CSS to match the 640px (do the math) and be done, without changing the width of sidebar at all, you will only lose a bit of margin between content and sidebar, but 2012 has lots of whitespace there so it woudn’t look too narrow but if you want to preserve that margin, then just decrease the width of sidebar ( defined in .widget-area ) with the same amount of % increased in .site-content.

    The second part:

    To my knowledge, there is no way to deregister the add_image_size used in set_post_thumbnail_size. Also, this part in 2012 is packed in one hook, so you have to redo all of that in child theme’s function.

    It’s a bit tricky, it invovles a weird behavior of after_setup_theme hook and the fact that function.php of Child theme is loaded first, so you have to have the remove_action( 'after_setup_theme', 'twentytwelve_setup' ); in a wraper function and then hook it at a priority lower than 10.

    Then roll your own 'after_setup_theme' started with a copy over from twentytwelve’s. In your case, it will be just the same copy with 624 in set_post_thumbnail_size replaced with 640.

    Regarding the thumbnail size, there is no need to unhook the set_post_thumbnail_size() from parent’s. Just redefine it in child theme’s setup function with a later hook order.

    See this post with complete details on how to make Twentytwelve wider.

    Modify the Width of the New WordPress Twenty Twelve Theme

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Changing widths to allow pictures to be 640 pixels wide’ is closed to new replies.