• Problem:

    For the option, “Display the under construction page that is part of the active theme,” the under-construction.php file is not checked in a child theme.

    On line 150 of ucOptions.php is where the plugin looks for the “under-construction.php” and sets a boolean to indicate it exists in the theme folder.

    $current_theme_has_uc_page = file_exists(<strong>get_template_directory()</strong> . '/under-construction.php');

    This is problematic because get_template_directory() will return the path to the parent theme when their is a child theme. The plugin needs to use the function get_stylesheet_directory() instead.

    See
    the WordPress Codex.

    I suggest modifying that line as an update to the plugin to avoid confusion and behave properly.

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • Thread Starter horizonm

    (@horizonm)

    Note – there was some incorrect HTML in the code sample – a strong tag got in there:

    $current_theme_has_uc_page = file_exists(get_template_directory() . '/under-construction.php');

    and I could have pasted the code per my suggestion to replace it with:

    $current_theme_has_uc_page = file_exists(get_stylesheet_directory() . '/under-construction.php');

Viewing 1 replies (of 1 total)
  • The topic ‘Tweak – Template Path Update for under-construction.php’ is closed to new replies.