WordPress.org

Support

Support » Themes and Templates » Changes to Child Theme not working

Changes to Child Theme not working

  • I’m trying to make certain simple adjustments to my twenty eleven child theme and nothing seems to be registering on the actual site. I’ve cut and paste code from the child theme help section in the codex and even that doesn’t work. Is there a setting or something that I am supposed to change?

Viewing 12 replies - 1 through 12 (of 12 total)
  • Ok, now I’m able to get some things to change. I.e. when I type in the following, the width of the header image changes:

    h1,headerimg{
    width: 50px;
    }

    If I try to do anything with the height (which is really what I’m trying to do) nothing happens. Why?!?

    Moderator Michael

    @alchymyth

    Forum Moderator

    the way your code is written is invalid as headerimg needs to be either a css class .headerimg or a css id #headerimg

    and .headerimg is none of the Twenty Eleven css selector;

    post a link to your site.

    The height of the header image in Twenty Eleven is set in functions.php, not in css. You’ll need to edit the line that looks like
    define( 'HEADER_IMAGE_HEIGHT', 333 );

    (Although I’m probably misremembering the exact height!)

    Once WordPress 3.4 comes out, you’ll be able to adjust the header to whatever height you like without touching code, but that’s still a few weeks away; it might be worth waiting for or not depending on your project schedule.

    esmi

    @esmi

    Forum Moderator

    In a child theme, you can currently add something like:

    add_filter( 'my_child_image_height', 'twentyeleven_header_image_heigh' );
    function my_child_image_heightt($height) {
    	$height = 200;
    	return $height;
    }

    to the child’s functions.php. Ditto for the header image width.

    Thank you all for your responses. I read through a lot of responses to other questions on here as well and am now seeing in some of your responses that I must edit some sort of .php. Where can I find functions.php or any other .php for that matter? I saw somewhere that it should be listed in the sidebar of the theme editor right under style.css and rtl.css but I don’t see it.

    esmi

    @esmi

    Forum Moderator

    Does your child theme have a functions.php file yet? If not, you need to create one.

    Oh, and here’s a link to my site:
    http://www.michaeldigiacinto.com

    Also, in the interim, the following seemed to work but it flattens the image a little:

    #branding img {
    height: 30%}

    How do you create a functions.php file? I tried consulting this:
    http://www.w3schools.com/php/php_functions.asp

    but I’m not sure where they’re telling me to type what they’re asking me to type. Please forgive my ignorance – I’m a total newbie to this whole thing!

    esmi

    @esmi

    Forum Moderator

    Just create a blank file in a plain text editor initially and upload it to your site. You then add any custom functions for your child theme to this file.

    ok, just created a blank file using a plain text editor and then went to upload it by clicking on media-add new and I got this message:

    “functions.php” has failed to upload due to an error
    Sorry, this file type is not permitted for security reasons.

    What did I do wrong?

    esmi

    @esmi

    Forum Moderator

    You need to use FTP (or whatever file management application your host provides) to upload the new file to your child’s theme folder in wp-content/themes.

    My apologies for not following up! I got it all to work. Slowly but surely, I’m learning. Thank you for your help!

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘Changes to Child Theme not working’ is closed to new replies.