function sf_maintenance_mode() { $options = get_option('sf_dante_options'); $custom_logo = $custom_logo_output = $maintenance_mode = ""; if (isset($options['custom_admin_login_logo'])) { $custom_logo = $options['custom_admin_login_logo']; } if ($custom_logo) { $custom_logo_output = '<img src="' . $custom_logo . '" alt="maintenance" style="margin: 0 auto; display: block;" />'; } else { $custom_logo_output = '<img src="' . get_template_directory_uri() . '/images/custom-login-logo.png" alt="maintenance" style="margin: 0 auto; display: block;" />'; } if (isset($options['enable_maintenance'])) { $maintenance_mode = $options['enable_maintenance']; } else { $maintenance_mode = false; } if ($maintenance_mode == 2) { $holding_page = __($options['maintenance_mode_page'], 'swiftframework'); $current_page_URL = sf_current_page_url(); $holding_page_URL = get_permalink($holding_page); if ($current_page_URL != $holding_page_URL) { if (!current_user_can('edit_themes') || !is_user_logged_in()) { wp_redirect($holding_page_URL); exit; } } } else { if ($maintenance_mode == 1) { if (!current_user_can('edit_themes') || !is_user_logged_in()) { wp_die($custom_logo_output . '<p style="text-align:center">' . __('We are currently in maintenance mode, please check back shortly.', 'swiftframework') . '</p>', get_bloginfo('name')); } } } }
<?php global $sf_options; $type = ""; if (isset($sf_options['404_type'])) { $type = $sf_options['404_type']; } if ($type == "page") { $page = __($sf_options['404_page'], 'swiftframework'); $current_page_URL = sf_current_page_url(); $page_URL = get_permalink($page); if ($current_page_URL != $page_URL) { wp_redirect($page_URL); exit; } } $error_content = __($sf_options['404_page_content'], 'swiftframework'); ?> <div class="help-text"> <?php echo $error_content; ?> </div> <form method="get" class="search-form" action="<?php echo home_url(); ?> /"> <input type="text" placeholder="<?php _e("Search", "swiftframework"); ?>