How to know if a child theme is being used?

  • Read the stylesheet. A child stylesheet must have Template:
    somethemename
    to function as a child theme.
  • Look in Appearance -> Themes. A child theme should have a notice
    about requiring a parent theme.
  • Use code similar to this (note: debugging only):

    add_action(
      'wp_head',
      function () {
        if (get_template_directory() === get_stylesheet_directory()) {
          echo 'not a child';
        } else {
          echo 'child';
        }
      }
    );
    

Reference:

http://codex.wordpress.org/Child_Themes

Leave a Comment