php 通过functions.php将Google字体添加到WP

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了php 通过functions.php将Google字体添加到WP相关的知识,希望对你有一定的参考价值。


<?php
function add_fonts() {
	// Styles Format:  wp_enqueue_style($handle, $src, $deps, $ver, $media);
        wp_register_style('open-sans', 'http://fonts.googleapis.com/css?family=Bree+Serif:400,300,700', array(), false, 'all');
        wp_enqueue_style( 'open-sans');
}
add_action('wp_enqueue_scripts', 'add_fonts', 100);

以上是关于php 通过functions.php将Google字体添加到WP的主要内容,如果未能解决你的问题,请参考以下文章

php 通过functions.php控制WP修订版

PHP Wordpress:通过functions.php自定义wp-login.php

PHP 通过functions.php禁用WordPress RSS-Feed

php 通过functions.php中的钩子在任何地方添加Beaver Builder模板

使用functions.php将Bootstrap排队到Wordpress

php 将此行添加到functions.php的底部,并确保后面没有空行。