• Hi,

    I’m using twentyeleven and I would like to remove the kind of search bar there is by default on the very top of a wordpress website. I’d like to remove it from my child theme.

    So far, i’ve not created a child header.php
    What i don’t understand is : if you want to add something to your header, you create a child header.php, you insert your thing and then the rest will be loaded with the parent header.php BUT if i want to REMOVE something that is on the parent header.php, how do i have to do ?

    Should i just make a full copy of the parent header.php and put it in the child theme folder ?

    Thanks for your help

    ps : i know how to remove it on the parent theme, i just don’t know how to deal with this and the child theme

Viewing 9 replies - 1 through 9 (of 9 total)
  • The child theme uses the entire header.php that is in the child theme (if one) – so you’d just make the change there. It won’t load part of the header.php from the parent.

    Hi Sonia,

    Think of it like this: generally, any template file you put on the child theme will override the template file on the parent theme.

    If you only want to override the header.php file, then just have that file on your child theme folder, and the rest of the template files will be taken from the parent theme.

    So, if you want to “remove” or “add” something then that is a modification which means you will want to override the file from the parent theme.

    So yes, just make a full copy of the parent header.php file and put it in the child theme folder and remove the search bar from that new file. WP will then use the file in the child theme instead of the file from the parent theme.

    Thread Starter SoniaTBB

    (@soniatbb)

    Thanks for your answer.
    So, the only thing i have to do (as i have no child-header so far), is to copy the original one to the child-folder and to modify it ?

    Exactly, copy header file to child-folder and modify the way you want.

    Thread Starter SoniaTBB

    (@soniatbb)

    Thanks a lot to both of you ??

    One last thing i want to be sure of : about style.css, i just have to create a child file, with the following code :

    /*
    Theme Name: Twenty ElevenChild
    Template: twentyeleven
    */
    @import url(“../twentyeleven/rtl.css”);

    Then the only things i need to add are the modifications i want. Right ? I don’t need to copy the whole file

    Thanks again

    Thread Starter SoniaTBB

    (@soniatbb)

    Speaking of the header but it doesn’t have anything to do with child theme.
    Look at my website please : https://www.soniarochel.com
    How can i modify the margin between the title of my website and the picture of the header ?

    Thanks

    Your child theme is not active – once you set it up, you have to switch to it — like switching to any other different theme.

    Thread Starter SoniaTBB

    (@soniatbb)

    I know it is not active.
    I think you don’t understand my question. Forget the parent or child theme. I want to know how to reduce the margin between the title and the picture of the header

    Thanks

    That space is created by the “site description” (tagline) – leaving it blank in your settings doesn’t get rid of it on the site. So try this:

    #site-description {
       display: none;
    }

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Child theme – Header’ is closed to new replies.