我是靠谱客的博主 俭朴篮球,这篇文章主要介绍wordpress style.css 不生效 缓存 cache问题,现在分享给大家,希望可以做个参考。

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-includestheme.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

最后

以上就是俭朴篮球最近收集整理的关于wordpress style.css 不生效 缓存 cache问题的全部内容,更多相关wordpress内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(124)

评论列表共有 0 条评论

立即
投稿
返回
顶部