WordPress website still loading old style.css

后端 未结 6 893
心在旅途
心在旅途 2021-02-08 07:08

I have made changes to style.css but the wordpress website is still showing old contents. I checked the file in FTP, and the changes in the file are there, but it\'s not showing

6条回答
  •  无人及你
    2021-02-08 07:42

    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 );
    }
    

提交回复
热议问题