wordpress style.css 不生效 缓存 cache问题

来源:互联网 发布:行业利润率算法 编辑:程序博客网 时间:2024/05/22 00:44

I had the same problem and I fixed it in another way than the default.

First I located the file that I need to change:

wp-includes\theme.php

There is a function called get_stylesheet_uri

My function looks like this:

function get_stylesheet_uri() {    $time = time();    $stylesheet_dir_uri = get_stylesheet_directory_uri();    $stylesheet_uri = $stylesheet_dir_uri . '/style.css?v='.$time;    /**     * Filter the URI of the current theme stylesheet.     *     * @since 1.5.0     *     * @param string $stylesheet_uri     Stylesheet URI for the current theme/child theme.     * @param string $stylesheet_dir_uri Stylesheet directory URI for the current theme/child theme.     */    return apply_filters( 'stylesheet_uri', $stylesheet_uri, $stylesheet_dir_uri );}
share
原创粉丝点击