0

I have created a child theme of a parent theme which shows correctly on wp theme selector and activates.

I have created a style.css of said child theme with the following meta information:

/*
 Theme Name:   Twenty Sixteen Child
 Theme URI:    http://localhost:888/wordpress-test/twentysixteen-child/
 Description:  My first child theme, based on Twenty Sixteen
 Author:       Juan D. Bolanos
 Author URI:   http://synchronygroup.com
 Template:     Twenty Sixteen
 Version:      1.0.0
 Tags:         black, green, white, light, dark, two-columns, three-columns, left-sidebar, right-sidebar, fixed-layout, responsive-layout, custom-background, custom-header, custom-menu, editor-style, featured-images, flexible-header, full-width-template, microformats, post-formats, rtl-language-support, sticky-post, theme-options, translation-ready, accessibility-ready, responsive-layout, infinite-scroll, post-slider, design, food, journal, magazine, news, photography, portfolio, clean, contemporary, dark, elegant, modern, professional, sophisticated
 Text Domain:  twentysixteen-child
*/

I have created a function.php file of said theme and used wp_enqueue_styles function as referenced here

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

I have included the wp_head() within my header.php and called into my index.php. The stylesheets are shown on the site, as shown in inspector, but the 'parent-theme' stylesheet points to the child theme directory as apposed to the parent directory.

I have ensured that the folder names match with the inclusion of '-child' on my child theme. I have read this documentation to ensure nothing was incorrect.

What could be possibly missing that would cause a misdirection in the directory?

  • You don't need to put -child on the end of a child themes folder, that's purely convention on the part of the WPMUdev people – Tom J Nowell Nov 3 '16 at 15:43
  • When you inspect your home page with developer tools, you should see a second styles.css file (your child theme version), overriding your parent styles.css file. Within your child theme styles.css file, go ahead and make your style modifications. – klewis Nov 3 '16 at 17:44
1

If you look at the original article:

Template:     twentyfourteen

We see that the folder twentyfourteen is mentioned, aka the "Twenty Fourteen" theme

Whereas you have:

Template:     Twenty Sixteen

Which is the human readable name of the theme, not the theme folder name. This is what you need to put:

Template:     twentysixteen
  • I replaced the template name with the folder name as suggested and saw no change in the directory path. Still goes to 'twentysixteen-child/style.css' – WeebleWobb Nov 3 '16 at 16:28
  • If this doesn't solve the problem then you should unmark it as the correct answer. Have you tried this in a clean install of the latest WordPress with only your child theme and parent theme installed? – Tom J Nowell Nov 3 '16 at 19:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.