Support » Themes and Templates » Twenty Twelve CHild Theme change header height

  • Resolved DerrickG72

    (@derrickg72)


    Where and how do I change the height of the header for my child theme?
    Here is the link to my site http://tintoys.com/wp-install2/
    I want to bring the tag line to me just underneath the logo and change the size of the header from 108 pxls in height to 80 pxls in height.

    I have checked themes functions and style.css and I cant find where I could change it.

Viewing 14 replies - 1 through 14 (of 14 total)
  • Moderator t-p

    (@t-p)

    try adding this snippet in in functions.php of the child theme:

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

    (@derrickg72)

    What if I dont have a functions.php in my child theme? Do I just create on and then add your code?

    Moderator t-p

    (@t-p)

    What if I dont have a functions.php in my child theme? Do I just create on and then add your code?

    – create one
    – Unlike style.css, the functions.php of a child theme does not override its counterpart from the parent. Instead, it is loaded in addition to the parent’s functions.php. (Specifically, it is loaded right before the parent’s file.)

    Thread Starter DerrickG72

    (@derrickg72)

    Now i get this strange error when I create the functions.php and then I add your code:
    function twentytwelvechild_custom_header_setup() { $header_args = array( 'height' => 108, 'width' => 950 ); add_theme_support( 'custom-header', $header_args ); } add_action( 'after_setup_theme', 'twentytwelvechild_custom_header_setup' );

    [Please post code & markup between backticks or use the code button. Your posted code may now have been permanently damaged by the forum’s parser.]

    Warning: Cannot modify header information – headers already sent by (output started at /home/tintoys/public_html/wp-install2/wp-content/themes/child/functions.php:5) in /home/tintoys/public_html/wp-install2/wp-includes/pluggable.php on line 876

    Thread Starter DerrickG72

    (@derrickg72)

    now I see that the code snippet shows in my dashboard panel
    function twentytwelvechild_custom_header_setup() { $header_args = array( 'height' => 120, 'width' => 950 ); add_theme_support( 'custom-header', $header_args ); } add_action( 'after_setup_theme', 'twentytwelvechild_custom_header_setup' );

    Assuming you created this functions.php file yourself, did you use a plain text editor to do so? And did you remember to start the file with <?php?

    Thread Starter DerrickG72

    (@derrickg72)

    Esmi, I created the file with file manger in my cpanel. Now that I went back and recreated my functions PHP I get this error: Parse error: syntax error, unexpected $end in /home/tintoys/public_html/wp-install2/wp-content/themes/child/functions.php on line 1

    I think there’s a problem with your new functions,php file. Delete it & try re-creating it using a plain text editor like Notepad – uploading to your child theme’s folder using your file manager.

    Thread Starter DerrickG72

    (@derrickg72)

    Ok, I will try that. And the only thing I need to add to the functions php is <?php? on the first line?

    Yes – followed by the code that Tara posted above.

    Thread Starter DerrickG72

    (@derrickg72)

    Ok, I downloaded the twenty twelve functions php and removed all the extra stuff and uploaded it to my child theme and all is well now.

    Thanks so much for all your help!

    Glad that hear that you’re up & running. 🙂

    Oh my god!! I had copy Tara’s code and paste into my Twenty Twelve CHild Theme function.php

    Now I could not access to my website anymore! And I can’t even edit my website anymore! when I enter my website address, it shows as below:

    “Parse error: syntax error, unexpected $end in /home3/peterboo/public_html/wp-content/themes/twentyeleven-child/functions.php on line 12”

    My godness!!! Anybody can please help me? Feeling to cry… my website is 8onlinemarketing.com

    Moderator t-p

    (@t-p)

    @peterboo: Note that this thread is marked “ressolved”.

    I will likely get more responses to your inquiry is you start your own thread.

    Having said that, Parse errors:

    Syntax Error

    A syntax error means that you have made a mistake while creating your PHP structure. You could, for example, be;
    ■ Missing a ; at the end of an individual line.
    ■ Using curly quotation marks.
    ■ Missing a curly bracket.

    When this error appears it will tell you which file the error appears in (functions.php, line 12 for example) and approximately which line (it may not always be the exact line so be sure to check just before and just after) in the code.

    source: http://codex.wordpress.org/Common_WordPress_Errors#Parse_errors

Viewing 14 replies - 1 through 14 (of 14 total)
  • The topic ‘Twenty Twelve CHild Theme change header height’ is closed to new replies.