setVariables(array( 'less-brand-primary' => esc_html($officialcore_colors_primary), 'less-brand-secondary' => esc_html($officialcore_colors_secondary) )); /* Make Less output minified */ $less->getCompiler()->setFormatter('compressed'); } /* * Determine main column size when sidebar 'left' and 'right' are active */ if (!function_exists('officialcore_columns_size')) { function officialcore_columns_size() { if ( is_active_sidebar('officialcore_sidebar_left_widgets_area') && is_active_sidebar('officialcore_sidebar_right_widgets_area') ) { // if both sidebar actived. $officialcore_columns_size = 6; } elseif ( is_active_sidebar('officialcore_sidebar_left_widgets_area') || is_active_sidebar('officialcore_sidebar_right_widgets_area') ) { // if only one sidebar actived. $officialcore_columns_size = 9; } else { // if no sidebar actived. $officialcore_columns_size = 12; } return $officialcore_columns_size; } } /* * Maintenance mode */ if (!function_exists('official_maintenance_mode')) { function official_maintenance_mode() { global $pagenow; $maintenance_setting = get_theme_mod('officialcore_maintenance_maintenance'); $maintenance_setting = $maintenance_setting == 'true'? true: false; $url = filter_input(INPUT_SERVER, 'REQUEST_URI'); if ( $pagenow !== 'wp-login.php' && ! current_user_can( 'manage_options' ) && ! is_admin() && $maintenance_setting == true || (strpos($url,'official-maintenance') == true ) ) { //header( 'HTTP/1.1 Service Unavailable', true, 503 ); //header( 'Content-Type: text/html; charset=utf-8' ); require_once get_template_directory() . '/maintenance.php'; die(); } } } add_action( 'wp_loaded', 'official_maintenance_mode' ); /* * Editor styles custom CSS * See https://codex.wordpress.org/Editor_Style */ function officialcore_editor_style() { add_editor_style( 'assets/css/custom-editor-style.css' ); } add_action( 'admin_init', 'officialcore_editor_style' );