• 0
    down vote
    favorite
    I am new to WordPress and I am just trying to help a friend customize his blog. I started doing this via the wp-admin Editor and CSS Editor until I found out this was a big no-no. So I set up a local environment and found out about child themes.

    I followed the codex to create a child theme of the Smart Magazine theme. I created a smart-magazine-child folder under wp-content/themes and added a style.css and functions.php file:

    This is how style.css is:

    /*
     Theme Name:   Smart Magazine Child
     Description:  Smart Magazine Child Theme
     Author:       Me
     Template:     smart-magazine
     Version:      1.0.0
     License:      GNU General Public License v2 or later
     License URI:  http://www.gnu.org/licenses/gpl-2.0.html
     Tags:         white, two-columns, right-sidebar, responsive-layout, custom-header, custom-background, custom-menu, custom-colors,  threaded-comments, translation-ready, featured-images, theme-options
     Text Domain:  smart-magazine-child
    */

    And this is functions.php:

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

    So it seems like both parent and child css files are being loaded as I inspect the source code:

    <link rel='stylesheet' id='parent-style-css'  href='http://sitename.dev/wp-content/themes/smart-magazine/style.css?ver=4.4.2' type='text/css' media='all' />
    <link rel='stylesheet' id='smart-magazine-style-css'  href='http://sitename.dev/wp-content/themes/smart-magazine-child/style.css?ver=4.4.2' type='text/css' media='all' />

    But the layout of the site is not being loaded. What I mean is that it looks like it has the default WordPress layout and the php files are not being overriden with the Smart Magazine (parent) php files.

    I have followed what the codex says and I have spent quite some time googling but people normally just have problems when loading the styles (which seems to be working fine with me), but I cannot find information about templates not overriding the default ones.

    I have tried making a duplicate of the theme folder and loading this copied theme into my local site. The result is the same: the theme is not being loaded, just the default php files. Maybe this misbehaviour gives a hint of why I am having this issue.

    What can it be and how can I solve it?

The topic ‘Child theme not loading parent layout’ is closed to new replies.