• I’m trying to create a child theme for twenty fourteen, but it doesn’t seem to be working. To start, I just created a directory called twentyfourteen-child in my themes directory and added a style.css containing the following (only difference being mydomain.com has my actual domain name):

    /*
     Theme Name:   Twenty Fourteen Child
     Theme URI:    http://mydomain.com/wp-content/themes/twentyfourteen-child/
     Description:  Twenty Fourteen Child Theme
     Author:       My Name
     Author URI:   http://mydomain.com
     Template:     twentyfourteen
     Version:      1.0.0
     License:      GNU General Public License v2 or later
     License URI:  http://www.gnu.org/licenses/gpl-2.0.html
     Tags:         light, dark, two-columns, right-sidebar, responsive-layout, accessibility-ready
     Text Domain:  twentyfourteen-child
    */

    I created a functions.php as follows:

    <?php
    add_action( 'wp_enqueue_scripts', 'theme_enqueue_styles' );
    function theme_enqueue_styles() {
        wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' );
        wp_enqueue_style( 'child-style',
            get_stylesheet_directory_uri() . '/style.css',
            array('parent-style')
        );
    }

    I activated the theme and would expect no difference given there are no customizations. But the site is mostly destroyed with none of the content visible in the sidebars and links moved to the top and bottom of the page. From what I understand, I don’t have to copy over any other files given any changes in my child theme will simply override existing files (with the exception of functions.php which will be added to the existing parent functions). Have I done something wrong here or do others have this problem too? Thanks!

Viewing 10 replies - 1 through 10 (of 10 total)
  • Hi there!

    I just created a child theme for Twenty Fourteen with the exact code you posted above and I’m not having any of the problems you mentioned.

    You are right in thinking no other files need to be copied over when creating the child theme.

    Could it perhaps be a caching problem in your browser? Might be worth clearing your browser’s cache and reloading a few times to make sure it’s not something simple.

    If that doesn’t work could you post a link to your site and we’ll take a look for you.

    I hope that helps šŸ™‚

    Luke the Daft Duke

    Thread Starter bsilverop

    (@bsilverop)

    Thanks, I had tried that but no luck. My left sidebar has moved to the top of the page and most of the content on the right sidebar has moved to the bottom. The site is login protected since it contains private information to the club that it’s for. I’m not sure the best way to get you those details other than maybe using the contact info on the web site linked to your user profile here?

    Hi again,

    I can’t actually suggest that you do that (forum rules) but I have one more idea for you:

    With your child theme activated go to Appearance -> Menus

    and make sure they are set in the correct Theme Locations and click ‘Save Menu’

    Sometimes you have to do this when changing themes.

    Cheers,

    Luke

    Thread Starter bsilverop

    (@bsilverop)

    Thanks for the reply. It’s very strange… Like you said, the appearance locations were not set, however setting them back as well as re-adding/configuring all my widgets just results in the content now being where it is supposed to as well as duplicated at the bottom of the page where it was displaying before. It seems this information is stored somewhere else given widgets that were missing were still showing at the bottom of the page (ie – Recent Posts was gone from the widgets section but WAS displayed at the bottom of the page). Odd that this all gets reset, but thanks for pointing that out, I hadn’t even thought to check there.

    Also try looking under Appearance -> Menus -> Manage Locations and make sure it’s correct.

    Failing that it’s hard to diagnose without seeing the site – perhaps a screenshot of the front page and your Widgets/Menu pages in the dashboard?

    Thread Starter bsilverop

    (@bsilverop)

    Thanks, that all looks ok. I’m basically just trying to do this on a copy of the site in a sandbox first before I do it on the live copy. Here’s a few screenshots if it helps, but understand it may not. The white boxes are just sections I’ve removed where there’s a name or something else. Normally nothing at all appears on the bottom of the page.

    Thanks again,

    Main Page

    Bottom of the page

    That looks like there is something in the ‘Footer Widget Area’ ?

    If so, remove it and that should sort out the bottom of the site.

    Other than that I’m afraid I’m out of ideas. It’s too difficult to tell what is going on without looking.

    Thread Starter bsilverop

    (@bsilverop)

    Oops…you’re right. I’m not sure how everything got moved around like this just by applying the child theme, but I’ll make sure to take screenshots of current settings and a full backup of the live site before doing this for sure šŸ™‚ Thanks again!

    Yeah, it can be confusing when you switch themes and everything’s moved around.

    I find it’s always best to create a child-theme before you do anything to a site to avoid getting frustrated šŸ™‚

    I’m glad it’s working for you now.

    Thread Starter bsilverop

    (@bsilverop)

    For sure, lesson learned. I was thinking the same when I started undoing my customizations to the parent theme due to conflicts once I implemented the child…”should have done this in the first place”, and now the menu/widget issue had me saying it again šŸ™‚ Hopefully that’s it and there’s nothing else I haven’t noticed yet. Thanks again!

Viewing 10 replies - 1 through 10 (of 10 total)

The topic ‘Problem creating child theme’ is closed to new replies.