您当前的位置:首页 > TAG信息列表 > wp-register-style

  • WordPress注册表样式调用不正确

    时间:2016-02-18

    为什么会出现此错误?Notice: wp_register_style was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. Please see Debugging in WordPress for more information

  • 取消排队、取消注册、删除操作-插件不起作用

    时间:2016-03-29

    几年前,我还没有掌握运行多站点网络的最佳实践,我经常使用网络激活插件。后来我意识到这是一个错误,因为并不是所有的网站都使用了一些插件。所以我在几个网站上有不必要的脚本和样式表。我开始为那些不需要的插件资源做的是wp_dequeue_style( \'style-sheet\' ); 和wp_deregister_style( \'style-sheet\' ); 在子主题函数中。php我的问题是,它并不适用于所有插件。例如https://wordpress.org/plugins/advanced-rec

  • 我注册样式表并将其加入队列,但未呈现任何内容

    时间:2016-05-04

    我被告知,在WordPress中注册和排队样式和脚本非常重要,尽管这真的很痛苦。我对脚本没有问题,但是当我尝试样式时,WordPress在样式表的代码中没有显示任何内容。我想养成以正确的方式构建主题的习惯,因此我想了解如何做到这一点,但我不明白为什么在添加脚本时没有将css添加到代码中。请参见下面的函数文件代码:<?php function alpha_scripts(){ $script = get_template_directory_uri() . \'

  • WP_ENQUEUE_SCRIPTS无效

    时间:2016-09-12

    我正在为创建一个主题Wordpress, 但是wp_enqueue_scripts 不起作用。中的代码functions.php 是:<?php function scripts_and_styles() { if ( ! is_admin() ) { wp_enqueue_script( \'jQuery\' ); wp_register_style( \'style.css\',get_template_directory_u

  • FONT更改默认WordPress字体很棒

    时间:2016-10-07

    我有一个WP插件,其中我使用了字体很棒的图标。我将Font Awesome文件夹添加到我的插件文件中,并告诉WordPress使用它们:// add font-awesome to admin area function ecp_admin_enqueue($hook) { // check if plugin page global $ecp_settings_page; if ( $hook != $ecp_settings_page ) {&#

  • 使用“嵌套”wp_Register_style时缺少dns预取链接

    时间:2016-11-22

    给定此脚本:function register_styles(){ wp_register_style(\'google-fonts\', \'//fonts.googleapis.com/css?family=Oswald|Open+Sans\'); wp_register_style(\'bootstrap\', get_template_directory_uri() . \'/css/bootstrap.min.css\', array(\'google-fonts

  • CUSTOM REGISTER_TAYNOMY INS未显示自定义导航菜单

    时间:2016-12-02

    我正在使用wordpress自定义贴子和register\\u分类,下面是我的代码。 function epg_works_register() { $labels = array( \'name\' => __(\'Works\'), \'singular_name\' => __(\'Works\'), \'add_new\' => __(\'Add Works Item\'),

  • 如何禁用特定帖子类型页面的主题中的所有CSS

    时间:2019-01-14

    我正在创建一个插件,当管理员登录时single-{post-type-slug}.php 不存在,该页https://my-site/post-type-slug/my-admin-page.php 无需加载主题css即可显示。我试过:wp_dequeue_style(\'screen\'); wp_deregister_style(\'screen\'); wp_dequeue_style(\'style\'); wp_deregister_style(\'style\