• I’m trying to create a child theme so I can delete the top menu on my site (Theme 2011). The codex file on that looks to be quite easy, but the first direction is: “Create A Directory”… I don’t know and can’t seem to find how to do that. Can anybody help? Please???

Viewing 13 replies - 16 through 28 (of 28 total)
  • Thread Starter tarotmeister

    (@tarotmeister)

    I do want it gone, but I don’t want it to interfere with the sidebar menu. I’ve created a child theme and I also found the piece of code alchymyth told me (last week) to delete after I had a child theme. I have copied and saved it in case I’m not really working in the child theme and I cause a big error. I should be able to just paste it back in…right? Here’s the code:

    [Code moderated as per the Forum Rules. Please use the pastebin]

    Can I safely remove it?

    Hi tarotmeister,
    You have the child theme that is great, now we can do this in a couple of minutes.

    Just checked and your child theme is not activated, Admin > Appearance > Themes, find the child theme and activate, it will not affect the content, but you might have to reset the background.

    With your file manager or ftp, download the file header.php from the twenty eleven theme folder, or just download the twenty eleven theme from WordPress extend, to your pc and extract header.php

    Ok, so now we have the twenty eleven header.php file open in notepad or a free syntax text editor like notepad++

    Now we are just going to add a little code to an existing line, find this line, about four from the bottom.
    <?php wp_nav_menu( array( 'theme_location' => 'primary' ) ); ?>

    We are going to add an element to the wp_nav_menu array.

    By default the fallback menu is list pages like on your website, we want to set this to blank so the list pages are not called.

    Default value not seen:
    'fallback_cb' => 'wp_page_menu'
    New added value:
    'fallback_cb' => ''

    So we add this and our line will now look like this:
    <?php wp_nav_menu( array( 'theme_location' => 'primary','fallback_cb' => '' ) ); ?>

    Then save the header.php file, upload this single new file to the child theme’s folder and NOT the twenty eleven folder (directory)

    Then check the website!

    Thats it, now when twenty eleven is updated your file is not over written, here is the change see line 118

    Why not just delete that line?

    Can I safely remove it?

    If later we wanted a menu, by editing the line and not deleting it, we can just create a menu as in my post above, assign this to the primary location and it will appear ‘like magic’ without having to find and replace code.

    All done? mark this as resolved!

    HTH

    David

    Thread Starter tarotmeister

    (@tarotmeister)

    This looks pretty straight forward. Before I start, though, I want to check one thing with you. The code I downloaded has a lot of instructions mixed in with it. Is that okay? Or am I in the wrong place? Duh…..

    Hi,
    Click on the ‘here is the change’ link in the post above, I have uploaded the changed file to pastebin so you can compare it, the file is header.php the line is 118, as in the post above.

    Forget any other code, follow these steps.

    1. Download header.php from twenty eleven
    2. Open the header.php file
    3. Find the line detailed above
    4. Make the change detailed above
    5. Save the header.php file
    6. Upload this to the child theme’s folder

    View the change, have a cup of tea and relax, or have a game of cards! lol

    David ??

    Thread Starter tarotmeister

    (@tarotmeister)

    A family issue took me away and this is the first chance I have to come back. I just found out that the child theme I thought I had created actually didn’t happen, and the GoDaddy tech I just talked to wouldn’t help me do it again. I am reviewing what you told me about cteating a child theme and also lookin into changing hosts for one recommended by WordPress. I’ll be back as soon as I have done SOMETHING about the child-theme issue. Again, thank you so much for your help and patience. Gary

    Hi everyone
    I am working with twenty ten theme which ue to be the default theme
    and I have a question related to the topic
    do I still need to create the child theme to avoid problem of overwritten files?
    thanks

    Yes if you made customizing on your style.css or templates then you will need create child and make changes there.

    https://codex.www.ads-software.com/Child_Themes#Directory_structure

    Thread Starter tarotmeister

    (@tarotmeister)

    I have spent all day trying to create a child theme on GoDaddy’s file manager. It would get created, but I couldn’t get it to activate. (GoDaddy wouldn’t help me with that.) All I managed to accomplish was to change some stuff on 2011 on my sites theme manager (or whatever it’s called). Doesn’t seem to have caused any problems, though, my site still comes up okay. I’m going to search around and see if I can find a theme in black or dark grey that doesn’t have that overhead menu. Wish me luck! If that doesn’t do it, I don’t know what I’ll do.
    Gary

    @govpatel
    ok then, just double check before going too far
    thanks
    xc

    @tarotmeister,
    Why not just use one of the starter themes, the instructions are not that hard to follow, just take your time.

    If it gets you going I will even create the child theme for you, just email me [email protected]

    Doesn’t seem to have caused any problems, though, my site still comes up okay.

    The issue is not changing the parent theme, yes the changes will work.

    Soon there will be an update of WordPress, and there is more than a likely chance that the Twenty Eleven theme will be updated.

    WARNING: The upgrade process will affect all files and folders included in the main WordPress installation. This includes all the core files used to run WordPress, two plugins (Akismet and Hello Dolly) and one theme (Twenty Ten). If you have made any modifications to those files, your changes will be lost.

    HTH

    David

    @esmi, I had already linked to your download as well as mine in this topic!

    Regards

    David

    Oops! Sorry ??

Viewing 13 replies - 16 through 28 (of 28 total)
  • The topic ‘About Child Themes’ is closed to new replies.