diff --git a/header.php b/header.php index 6f5abb19..99763a4a 100755 --- a/header.php +++ b/header.php @@ -10,15 +10,11 @@ - - - " . pk_get_option('css_code_header', '') . ""; ?> -
diff --git a/inc/init.php b/inc/init.php index 0b3541e5..0dd95c61 100755 --- a/inc/init.php +++ b/inc/init.php @@ -171,7 +171,6 @@ function pk_init_register_assets() wp_enqueue_style('puock-strawberry-icon-admin', pk_get_static_url() . '/assets/libs/strawberry-icon.css', [], PUOCK_CUR_VER_STR); wp_enqueue_script('puock-admin', pk_get_static_url() . '/assets/dist/js/admin.min.js', [], PUOCK_CUR_VER_STR, true); } else { -// wp_deregister_script('jquery'); wp_register_script('jquery', pk_get_static_url() . '/assets/libs/jquery.min.js', [], PUOCK_CUR_VER_STR); wp_enqueue_script('jquery'); wp_enqueue_style('puock-libs', pk_get_static_url() . '/assets/dist/style/libs.min.css', [], PUOCK_CUR_VER_STR); @@ -193,6 +192,21 @@ function pk_init_register_assets() wp_enqueue_script('puock-gt4', pk_get_static_url() . '/assets/libs/gt4.js', [], PUOCK_CUR_VER_STR, true); } wp_enqueue_script('puock', pk_get_static_url() . '/assets/dist/js/puock.min.js', array('puock-libs'), PUOCK_CUR_VER_STR, true); + + //加载全站黑白样式 + if(pk_is_checked('grey')){ + wp_add_inline_style( 'puock', 'html { + filter: grayscale(100%); + -webkit-filter: grayscale(100%); + -moz-filter: grayscale(100%); + -o-filter: grayscale(100%); + }'); + } + + //加载自定义样式 + if (!empty(pk_get_option('css_code_header', ''))){ + wp_add_inline_style( 'puock', pk_get_option('css_code_header', '')); + } } } diff --git a/templates/css-grey.php b/templates/css-grey.php deleted file mode 100644 index 92b1e5aa..00000000 --- a/templates/css-grey.php +++ /dev/null @@ -1,12 +0,0 @@ - - -