博主头像
Wood Chen

万事如意

  • 累计撰写 279 篇文章
  • 累计创建 238 个标签
  • 累计收到 20 条评论

目 录CONTENT

Wordpress Neve主题 添加自定义字体到“主题自定义”处

2023-03-03 · 0 评论 · 0 点赞 · 140 阅读 · 0 字
//neve主题添加自定义字体
function add_custom_font() { 
	$font_path_ttf = get_stylesheet_directory_uri() . '/fonts/BionicKidSimpleSlanted.ttf';
	?>
	<style type="text/css">
	@font-face {
		font-family: 'BionicKidSimpleSlanted';
		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'][] = 'BionicKidSimpleSlanted';
	return $localized_data;
}
add_filter( 'neve_react_controls_localization', 'add_custom_fonts' );

评论区