wordpress 怎么重新加载css
第 3、4 行:最后的 'true'告诉WordPress在页面底部加载这些脚本。
function footerScript() {wp_register_script('jquery', ("/jquery.js"), false, '', true );wp_register_script( 'default', get_template_directory_uri() . '/jquery.js', false, '', true );if ( !is_admin() ) { wp_deregister_script( 'jquery' );wp_enqueue_script( 'jquery' );wp_enqueue_script( 'default' );}}add_action( 'init', 'footerScript' );
如何在wordpress站点中加载bootstrap的css
1.首先找到wordpress菜单中的class类名2.在wordpress模版目录下一般在wp-content\themes\主题名,找到style.css3.在style.css中为类名添加样式,如下:.menu-item:{color:red;}这样就可以设计菜单css样式了
WordPress怎么可以去除或更换head里面默认加载的js和CSS
第一种方法:安装Disable Google Font插件,但经过测试之后,没有明显效果。
(不推荐)第二种方法:注释或删除掉style.css和function.php有关加载Google字体的代码fonts.googleapis.com即可。
第三种方法:将以下代码添加到主题目录下的functions.php中如果在更改style.css或function.php文件之后,wordpress网站报错,无法打开,或者新建文章时上传图片失败。
一定是将wordpress文件的编码保存为非ANSI编码,用记事本打开,保存时选择编码ANSI替换掉原来的文件即可。
class Disable_Google_Fonts {public function __construct() {add_filter( 'gettext_with_context', array( $this, 'disable_open_sans' ), 888, 4 );}public function disable_open_sans( $translations, $text, $context, $domain ) {if ( 'Open Sans font: on or off' == $context && 'on' == $text ) {$translations = 'off';}return $translations;}}$disable_google_fonts = new Disable_Google_Fonts;不会的可以来小小WP 看看 或者留言给我
转载请注明出处51数据库 » wordpress加载css