【问题标题】:How I can load a css file in all dashboard pages and my wp theme? [closed]如何在所有仪表板页面和我的 wp 主题中加载 css 文件? [关闭]
【发布时间】:2015-10-24 02:08:35
【问题描述】:

如何使用 wp_enqueue_style 在所有仪表板页面和我的 WP 主题中加载 css 文件? 我的 CMS 是 WordPress。

【问题讨论】:

标签: css wordpress


【解决方案1】:

把它放到你的functions.php中,同时确保在正确的位置创建.css文件。这是法典的link

function load_custom_wp_admin_style() {
        wp_register_style( 'custom_wp_admin_css', get_template_directory_uri() . '/admin-style.css', false, '1.0.0' );
        wp_enqueue_style( 'custom_wp_admin_css' );
}
add_action( 'admin_enqueue_scripts', 'load_custom_wp_admin_style' );

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-04-30
    • 2019-07-05
    • 1970-01-01
    • 2017-10-22
    • 2021-08-10
    相关资源
    最近更新 更多