Coming Soon Page
-
Hey All,
I wonder if there is a way in WordPress to add say a comingsoon.php file to the active Theme directory and have WordPress call that for any non logged in users if the file exists?
Could you do something like this? Or is there another better way?
function ComingSoon(){ // Check if coming soon file exists $file = get_theme_root() . "/theme_folder/comingsoon.php"; if(file_exists($file)){ // If user not logged in as an admin or sorts if(!current_user_can('edit_themes') || !is_user_logged_in()){ // Show Coming Soon page header("Location: /".$file); } } } add_action('init', 'ComingSoon');
Dan
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Coming Soon Page’ is closed to new replies.