脚本宝典收集整理的这篇文章主要介绍了php – 在WordPress站点中使用AWS S3上托管的自定义字体,脚本宝典觉得挺不错的,现在分享给大家,也给大家做个参考。
add_action( 'wp_head','my_fonts' ); function my_fonts(){ ?> <link rel="stylesheet" tyPE="text/css" href="//cloud.typography.com/7783912/761788/css/fonts.css"> <?PHP }
字体仍未显示.我究竟做错了什么?
wp_enqueue_style
.使用此函数还可以将此字体声明为其他样式表的依赖项.你还应该使用’wp_enqueue_scripts’钩子,而不是’wp_head’:
/** * PRoper way to enqueue scripts and styles */ function theme_name_scripts() { wp_enqueue_style( 'typography','//cloud.typography.com/7783912/761788/css/fonts.css' ); } add_action( 'wp_enqueue_scripts','theme_name_scripts' );
以上是脚本宝典为你收集整理的php – 在WordPress站点中使用AWS S3上托管的自定义字体全部内容,希望文章能够帮你解决php – 在WordPress站点中使用AWS S3上托管的自定义字体所遇到的问题。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。