//neve主题添加自定义字体
function add_custom_font() {
$font_path_ttf = 'https://cdn.xxx.xxx/fonts.woff2';
?>
<style type="text/css">
@font-face {
font-family: '字体名字';
src: url( <?php echo esc_url( $font_path_ttf ); ?>) format('truetype');
}
</style>
<?php
}
add_action( 'wp_head', 'add_custom_font' );
add_action( 'customize_controls_print_styles', 'add_custom_font' );
function add_custom_fonts( $localized_data ) {
$localized_data['fonts']['Custom'][] = '字体名字';
return $localized_data;
}
add_filter( 'neve_react_controls_localization', 'add_custom_fonts' );
版权属于:
woodchen
作品采用:
《
署名-非商业性使用-相同方式共享 4.0 国际 (CC BY-NC-SA 4.0)
》许可协议授权
评论 (0)