• 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/

Viewing 1 replies (of 1 total)
  • 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.