• Resolved cva1983

    (@cva1983)


    Hi, How can I reduce my header image height in twenty-ten? I tried to alter it in a child theme functions.php file, and located the correct code, but understand that the parent functions.php file over-writes this somehow? I kept getting an error message and had to delete the child functions.php entirely

    Help! Thanks

Viewing 9 replies - 1 through 9 (of 9 total)
  • Add to your child’s functions.php file:

    // Increase header image height to 250px
    function sg_header_height($height) {
    	$height = 250;
    	return $height;
    }
    add_filter( 'twentyten_header_image_height', 'sg_header_height' );
    Thread Starter cva1983

    (@cva1983)

    I can’t seem to create a child functions.php! I have done a header/ footer.php and CSS Style fine, but a child functions.php theme in twenty ten seems to create an error? Thank you.

    Create a new file called functions.php in a plain text editor, add:

    <?php
    // Increase header image height to 250px
    function sg_header_height($height) {
    	$height = 250;
    	return $height;
    }
    add_filter( 'twentyten_header_image_height', 'sg_header_height' );

    Upload to your child theme.

    Thread Starter cva1983

    (@cva1983)

    Thank you. How do I now reduce the gap between the top of my (reduced height) image and the top of the browser?

    By amending your child theme’s CSS. I recommend using Firefox and the Firebug add-on for this kind of work.

    Thread Starter cva1983

    (@cva1983)

    Can I ask why? I’m a little novice! Thanks

    Why what?

    Thread Starter cva1983

    (@cva1983)

    Why I should be using firefox and the firebug?

    Finally, is it possible to set different elements on different pages in twenty ten? eg on the home page I have created a small gap between my menu bar and the solo master image, but I would like to increase this gap on other pages with out changing it on the home page.

    Best.

    Why I should be using firefox and the firebug?

    Because it makes identifying the relevant CSS that you need to change so much easier.

    inally, is it possible to set different elements on different pages in twenty ten?

    Yes. If you check out the source markup for each page, you’ll see that each has its own set of <body> classes – some of which will be unique to that page. You should be able to style using selectors such as .home .main etc.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Reducing header image height in a child theme’ is closed to new replies.