I am redesigning a template. So I am trying to show a holding page till the redesign process is done.
I ever used following function for the purpose on many other projects and it's redirected to the holding.php
if the user is not an Admin
add_action( 'template_redirect', function() {
if( !current_user_can( 'manage_options' ) ) {
include( get_template_directory() . '/holding.php' );
exit;
}
});
But when I try to put this code on my current redesigning project it's shows a blank page if I go to the home page or any other page.
if I remove the above code from function.php
the site works fine.
And I've noted that this current projects' all php file has
/**
* @package WordPress
* @subpackage Starkers
*/
my theme folder contains WordPress, Starkers
too
I thought it's commented out. so it does nothing.
Those lines are included every files such as index.php, function.php, etc
Why it's showing a blank page if I add the redirection function as I mentioned below.?? Any help will be appreciated.
[UPDATE] when I enable the debug i got the following lines.
Notice: load_plugin_textdomain was called with an argument that is deprecated since version 2.7 with no alternative available. in /home/supgower/public_html/wp-includes/functions.php on line 3008
Notice: date_default_timezone_set() [function.date-default-timezone-set]: Timezone ID 'UTC-1' is invalid in /home/supgower/public_html/wp-content/plugins/event-calendar/tz.php on line 27
Notice: date_default_timezone_set() [function.date-default-timezone-set]: Timezone ID 'UTC-1' is invalid in /home/supgower/public_html/wp-content/plugins/event-calendar/tz.php on line 27
Notice: wp_enqueue_script was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. Please see Debugging in WordPress for more information. (This message was added in version 3.3.) in /home/supgower/public_html/wp-includes/functions.php on line 3049
Notice: wp_enqueue_style was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. Please see Debugging in WordPress for more information. (This message was added in version 3.3.) in /home/supgower/public_html/wp-includes/functions.php on line 3049