My Digital Garden

Wordpress Child Theme Database Hack

Wordpress Child Theme Database Hack

In WordPress a child theme is a set of code, style and configuration customisations applied to a base theme.

The defined way to signla that a theme is a child-theme is top ensure tha tthe start of the style.css file a tthe top level of the theme folder has a comment with the following minimums:

/*
Theme Name – needs to be unique to your theme
Template – the name of the parent theme directory.
*/

It's not unknown for this information to get mangled, especially when the CSS is generated, however provided the information was there when the theme was first selected, the site will continue to work.

If the theme later stops behaving like a child theme (e.g. classes and functions from the parent not being found) then check the wp_options table in the site database for these option_name keys:

option_name Required value
template name of the parent theme directory
stylesheet name of the child theme directory

See also