Support » Fixing WordPress » Twenty Twelve Header size reduction

  • Hey all,

    I’ve got a twenty twelve child theme and thanks to Alchymyth, I’ve moved the menu to below the header, but it’s still huge and would like to reduce it’s height and maybe reduce the padding of the header. Any advice on how to do that? I’ve looked around and I’ve only seen stuff pertaining to the twenty eleven theme.

    http://www.heavybrunch.com

    Thanks!

Viewing 15 replies - 1 through 15 (of 17 total)
  • Are you referring to the logo? If so that is a picture as you can see below.

    http://www.heavybrunch.com/wp-content/uploads/2012/11/heavy-Brunch.png

    To make it smaller the best way is to make a new image to the size you want it.

    No, sorry. I could have been more specific.

    The header size is 950×260, and I want to reduce the header height to maybe 150px, and reduce the padding above it to keep it closer to the top of the page.

    I just quickly made a png of the dimensions specified by the header.

    Any thoughts?

    although you seem to have fixed it already, here is a way to change the header image dimensions:

    in functions.php of the child theme, add:

    function twentytwelvechild_custom_header_setup() {
    	$header_args = array( 'height' => 150, 'width' => 950 );
    	add_theme_support( 'custom-header', $header_args );
    }
    add_action( 'after_setup_theme', 'twentytwelvechild_custom_header_setup' );

    the padding comes from:

    /* Header */
    .site-header {
    	padding: 24px 0;
    	padding: 1.714285714rem 0;
    }

    Nice, thanks for this.

    I initially just reduced the header image size in photoshop and uploaded it with the 150px height dimensions. I just copied your functions code and uploaded that and it looks great, but the header change shows on the home page and not any other pages on the site – it reverts back to the original image and size. I cleared cache but it hasn’t changed.

    Actually, after I uploaded a blank functions.php with your copied code, I was unable to access the dashboard of the site, so I removed the functions.php file and it was back to normal.

    Did you add the code to functions.php appropriately? As in, adding in the appropriate opening php tag?

    <?php
    
    //Add in your custom code below here
    
    function twentytwelvechild_custom_header_setup() {
    	$header_args = array( 'height' => 150, 'width' => 950 );
    	add_theme_support( 'custom-header', $header_args );
    }
    add_action( 'after_setup_theme', 'twentytwelvechild_custom_header_setup' );

    I’ve added a new functions.php from a php in dreamweaver to your spec and it ended up on the homepage above the header.

    http://www.heavybrunch.com

    I don’t see it there….

    I just removed the functions.php all together because anything I would upload regarding the php code would show up above the header.

    And I’ve tried clearing cache but it’s not working either. I see there is nothing above the header on another computer though.

    Are you sure your files are getting saved as php files?

    If your text is just showing up … that’s odd

    Yeah, I created a new php file in dreamweaver, copied the above code and uploaded it to my child theme.

    Then all the code shows up above the header, so I just removed the functions.php file altogether and the header looks fine but some of the posts aren’t showing up. Is it a caching issue? I’ve got two computers up and the site looks different using chrome as a browser on both computers.

    If there’s no functions.php how is it working?

    Hi,

    I posted the code recommended by alchymyth, The Sweeper & Moderator to change header dimensions and now I cannot access my dashboard at all and when I go to my website there is just a blank page.

    Can someone please tell mw how to fix this (what feels to me as) very big problem. It’s urgent as I have an ad that begin to run tomorrow. : (

    Thanks so much.

    using FTP or the file management system of your hoster, rename functions.php of your child theme to something like old-functions.php

    this should allow you back into your site;
    you can then edit old-functions.php and repair the wrong edits.

    review
    http://codex.wordpress.org/Child_Themes#Using_functions.php

    thanks for your prompt reply! I’ll try your suggestion.

    The only change I had made to functions.php was to paste the suggested code since I wanted to achieve the same end (which is what I do when working with my ElegantThemes template). I made no other changes.

    I’m am not a WP expert or web developer, so my knowledge is limited. Is it possible for you to provide the original code for functions.php so I can just copy and paste once I get back into my account and avoid further missteps?

    Thanks again!

    there is no ‘original’ code for a functions.php of a child theme; it starts of empty apart from the php tags directly at the start and the end:

    <?php
    
    ?>

    if you are not using a child theme of Twenty Twelve, then do not use the code.

    there is no ‘copy and paste’ suggestion.

Viewing 15 replies - 1 through 15 (of 17 total)
  • The topic ‘Twenty Twelve Header size reduction’ is closed to new replies.