Title: Child theme compatibility
Last modified: August 21, 2016

---

# Child theme compatibility

 *  [Alice Brosey](https://wordpress.org/support/users/ambrosey/)
 * (@ambrosey)
 * [12 years, 3 months ago](https://wordpress.org/support/topic/child-theme-compatibility/)
 * To make this work with a child theme itself, the following changes can be made
   to the plugin… I tried to make a request thread and it closed itself with no 
   responses. I do not understand how that happened. This is useful to other people
   and I don’t know why my thread of 6 minutes ago was removed.
 * I believe this does it, but it would be great to be part of actual plugin:
    change
   line 125 underConstruction.php from
 *  `require_once(get_template_directory() . '/under-construction.php');`
 *  to
    `if(file_exists(get_stylesheet_directory() . ‘/under-construction.php’)){
   require_once(get_stylesheet_directory() . ‘/under-construction.php’); } else {
   require_once(get_template_directory() . ‘/under-construction.php’); }`
 * change ucOptions.php line 149 from
    `$current_theme_has_uc_page = file_exists(
   get_template_directory() . '/under-construction.php');` to
 *     ```
       $current_theme_has_uc_page = file_exists(get_template_directory() . '/under-construction.php');
       if(!$current_theme_has_uc_page){
       $current_theme_has_uc_page = file_exists(get_stylesheet_directory() . '/under-construction.php');
       }
       ```
   
 * [https://wordpress.org/plugins/underconstruction/](https://wordpress.org/plugins/underconstruction/)

Viewing 1 replies (of 1 total)

 *  [anou](https://wordpress.org/support/users/anou/)
 * (@anou)
 * [12 years, 2 months ago](https://wordpress.org/support/topic/child-theme-compatibility/#post-4738705)
 * I think maybe just changing
    `get_template_directory()` by `get_stylesheet_directory()`
   should do the trick, because it works for theme and child-theme. And if a child-
   theme is active it will retrieve the child-theme directory without bothering 
   of the parent theme.

Viewing 1 replies (of 1 total)

The topic ‘Child theme compatibility’ is closed to new replies.

 * ![](https://ps.w.org/underconstruction/assets/icon-256x256.png?rev=2223095)
 * [underConstruction](https://wordpress.org/plugins/underconstruction/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/underconstruction/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/underconstruction/)
 * [Active Topics](https://wordpress.org/support/plugin/underconstruction/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/underconstruction/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/underconstruction/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [anou](https://wordpress.org/support/users/anou/)
 * Last activity: [12 years, 2 months ago](https://wordpress.org/support/topic/child-theme-compatibility/#post-4738705)
 * Status: not resolved