0

I can't load newer style.css changes I've made into my wordpress theme, its pulling an older version of that file / ignoring any new changes I've made/saved.

In functions.php under the root of my theme folder "humescores" I have this to enqueue my stylesheets

function humescores_scripts() {
        //Enqueue Google fonts: Source Sans Pro and PT Serif
        wp_enqueue_style('humescores-fonts','https://fonts.googleapis.com/css?family=PT+Serif:400,400i,700,700i|Source+Sans+Pro:400,400i,600,900');

    //Connects style.css
    wp_enqueue_style( 'humescores-style', get_stylesheet_uri() );

    wp_enqueue_script( 'humescores-navigation', get_template_directory_uri() . '/js/navigation.js', array(), '20151215', true );

    wp_enqueue_script( 'humescores-skip-link-focus-fix', get_template_directory_uri() . '/js/skip-link-focus-fix.js', array(), '20151215', true );

    if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {
        wp_enqueue_script( 'comment-reply' );
    }
}
add_action( 'wp_enqueue_scripts', 'humescores_scripts' );

Directory Structure

enter image description here

4 Answers 4

2

Try this,

function humescores_scripts() {
        //Enqueue Google fonts: Source Sans Pro and PT Serif
        wp_enqueue_style('humescores-fonts','https://fonts.googleapis.com/css?family=PT+Serif:400,400i,700,700i|Source+Sans+Pro:400,400i,600,900');

    //Connects style.css
    wp_enqueue_style( 'humescores-style', get_stylesheet_uri(), array(), time());

    wp_enqueue_script( 'humescores-navigation', get_template_directory_uri() . '/js/navigation.js', array(), '20151215', true );

    wp_enqueue_script( 'humescores-skip-link-focus-fix', get_template_directory_uri() . '/js/skip-link-focus-fix.js', array(), '20151215', true );

    if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {
        wp_enqueue_script( 'comment-reply' );
    }
}
add_action( 'wp_enqueue_scripts', 'humescores_scripts' );
Sign up to request clarification or add additional context in comments.

Comments

1
wp_enqueue_style('YOUR_NAME_STYLE', get_template_directory_uri() . '/style.css');

1 Comment

what's wrong with my enqueue style though wp_enqueue_style( 'humescores-style', get_stylesheet_uri() ); doesn't it do the same thing?
1

First make sure you write the right path to call style.css file you can call style file with two method

  1. wp_head() function in the head of the page or call the function name in the header page that call style files or scripts files

    In your case your function name is humescores_scripts() call this function in the header page

    <?php humescores_scripts(); ?>
    

you can also call the main style file in the header page

<?php wp_enqueue_style( 'style', get_stylesheet_uri() );?>

After making sure of this press shift+f5 or fn+f5 from keyboard to refresh and redownload the cache of files in browser

2 Comments

ah okay I was actually wandering what the force purge cache shortcut button was. what's wrong with my enqueue style though wp_enqueue_style( 'humescores-style', get_stylesheet_uri() ); doesn't it do the same thing?
I edit my answer call your function name in the header page @Kagerjay
0

found problem

google chromium decided to ignore changes (because the changes were so small, all I edited was an h1 tags color) so I cleared out my browser cache, and refreshed page, it works now

https://codex.wordpress.org/I_Make_Changes_and_Nothing_Happens

1 Comment

Loading up Google Chrome & Google Chromium after the fact, via browser-sync, I did not clear chromes cache and it still has original problem, but chromium does not after clearing cache, so this is how i know its a browser issue

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.