Skip to content

Commit

Permalink
fix: fonts设置
Browse files Browse the repository at this point in the history
  • Loading branch information
bymoye committed Sep 27, 2021
1 parent f2e733c commit 97adf18
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -1456,7 +1456,7 @@ function custom_admin_open_sans_style()
// WordPress Custom Font @ Admin
function custom_admin_open_sans_font()
{
echo '<link href="https://fonts.maho.cc/css?family=Merriweather+Sans|Noto+Serif+SC&display=swap" rel="stylesheet">' . PHP_EOL;
echo '<link href="https://' . iro_opt('google_fonts_api') .'/css?family=Merriweather+Sans|Noto+Serif+SC&display=swap" rel="stylesheet">' . PHP_EOL;
echo '<style>body, #wpadminbar *:not([class="ab-icon"]), .wp-core-ui, .media-menu, .media-frame *, .media-modal *{font-family:"Noto Serif SC","Source Han Serif SC","Source Han Serif","source-han-serif-sc","PT Serif","SongTi SC","MicroSoft Yahei",Georgia,serif !important;}</style>' . PHP_EOL;
}
add_action('admin_head', 'custom_admin_open_sans_font');
Expand All @@ -1465,7 +1465,7 @@ function custom_admin_open_sans_font()
function custom_admin_open_sans_font_frontend_toolbar()
{
if (current_user_can('administrator')) {
echo '<link href="https://fonts.maho.cc/css?family=Merriweather+Sans&display=swap" rel="stylesheet">' . PHP_EOL;
echo '<link href="https://' . iro_opt('google_fonts_api') .'/css?family=Merriweather+Sans&display=swap" rel="stylesheet">' . PHP_EOL;
echo '<style>#wpadminbar *:not([class="ab-icon"]){font-family:"Noto Serif SC","Source Han Serif SC","Source Han Serif","source-han-serif-sc","PT Serif","SongTi SC","MicroSoft Yahei",Georgia,serif !important;}</style>' . PHP_EOL;
}
}
Expand All @@ -1475,7 +1475,7 @@ function custom_admin_open_sans_font_frontend_toolbar()
function custom_admin_open_sans_font_login_page()
{
if (stripos($_SERVER["SCRIPT_NAME"], strrchr(wp_login_url(), '/')) !== false) {
echo '<link href="https://fonts.maho.cc/css?family=Noto+Serif+SC&display=swap" rel="stylesheet">' . PHP_EOL;
echo '<link href="https://' . iro_opt('google_fonts_api') .'/css?family=Noto+Serif+SC&display=swap" rel="stylesheet">' . PHP_EOL;
echo '<style>body{font-family:"Noto Serif SC","Source Han Serif SC","Source Han Serif","source-han-serif-sc","PT Serif","SongTi SC","MicroSoft Yahei",Georgia,serif !important;}</style>' . PHP_EOL;
}
}
Expand Down

0 comments on commit 97adf18

Please sign in to comment.