WordPress.org

Ready to get started?Download WordPress

Forums

Changes to Child Theme not working (13 posts)

  1. mvd205
    Member
    Posted 2 years ago #

    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?

  2. mvd205
    Member
    Posted 2 years ago #

    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?!?

  3. alchymyth
    The Sweeper & Moderator
    Posted 2 years ago #

    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.

  4. 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.

  5. esmi
    Forum Moderator
    Posted 2 years ago #

    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.

  6. mvd205
    Member
    Posted 2 years ago #

    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.

  7. esmi
    Forum Moderator
    Posted 2 years ago #

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

  8. mvd205
    Member
    Posted 2 years ago #

    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%}

  9. mvd205
    Member
    Posted 2 years ago #

    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!

  10. esmi
    Forum Moderator
    Posted 2 years ago #

    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.

  11. mvd205
    Member
    Posted 2 years ago #

    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?

  12. esmi
    Forum Moderator
    Posted 2 years ago #

    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.

  13. mvd205
    Member
    Posted 2 years ago #

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

Topic Closed

This topic has been closed to new replies.

About this Topic