Child Theme Performance

When you set a child theme, basically WP looks into 2 directories to see if there are some overriding to make. So it adds some impact on performance. The use of @import in child CSS can also have some bad impact on performance grade.

Most of the time, it depends on the parent’s theme quality. For example if the developer has prepared his theme for child theme you should find a if( !function_exists() ) before his functions. That allows you to easily modify function in your child theme simply because child functions.php is loaded before unlike other files.

What I like to do to customize a child theme is to add my own class to the body and play with selectors because I hate using !important in CSS code :

add_filter('body_class','_add_child_theme_body_class');
function _add_child_theme_body_class($classes) {
$classes[] = 'your-class';
return $classes;
}

Then I can style like that :

.your-class #page {}

You have to ask yourself about what you want to do. We use child theme for maintenance. But performance is definitely a drawback.

You may counterbalance this with some good caching solution.

Leave a Comment