Child Theme Wizard – Version 1.4 released

- by

I’ve pushed a new version of my Child Theme Wizard plugin to WordPress today. While the changes are very simple, the implications of this update are rather significant for using child themes.

From time to time, best practices for how to create your child theme change. This has happened several times over the course of this plugins 5+ year life span. Often it is down to users that I get to find out about such changes.

Something similar has happened this time, when Marcin contacted me about a missing variable declaration ($parent_style), without which child themes can under certain circumstances malfunction. The old P2 theme is such a candidate. Marcin left a comment on the original release post for this plugin from 2014 and told me I was missing a line in the code that’s generated. Thank you so much for your help, I really appreciate the heads up 🙂

Now it’s in place, and I can sleep easy again. Apart form this major change, I’ve also taken the opportunity to update the link to the official WordPress documentation for Child Themes, which is in the process of migrating over to developer.wordpress.org. And while I was at it, I also made sure the plugin is now certified to run with WordPress 5.2.

Upgrade from the WordPress admin interface, take a look at the reviews on the WordPress.org, or grab a copy of the code from my GitHub repository. Pull requests are always welcome!

Upgrading existing Child Themes

If you’re previously created your child theme using my plugin, and you’d like to back-port the changes introduced in version 1.4 to your current theme, take a look at your child theme’s functions.php file. It should contain a function like the one below:

function your_theme_enqueue_styles() {
$parent_style = 'parent-style';
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),
wp_get_theme()->get('Version')
);
}
view raw functions.php hosted with ❤ by GitHub

Copy the code above and replace the the function you’ve got running at the moment, and it’s like you’ve created a child theme with the current version. This is an optional step, if you feel your child theme is running fine as it is, don’t worry about it.

If you have any questions, please let me know 🙂



If you enjoy my content, please consider supporting me on Ko-fi. In return you can browse this whole site without any pesky ads! More details here.

Leave a Comment!

This site uses Akismet to reduce spam. Learn how your comment data is processed.