0

I am using Bootstrap to put together a Wordpress. I update all my files locally and upload them through Sublime's SFTP. I also use Cyberduck to double check whether changes have gone through fully. Everything is going pretty smoothly and I can change files with ease, and see them updated with a simple refresh. However when it comes to the style.css file, updating is a doozy. I make my changes to the file, upload them, but see no changes reflected when I reload. To see the changes I have to reload the theme then make the change, upload the changed file via SFTP and reload. However, I can only do this once before refresh doesn't work any more.

In my header.php I load style.css using this php function:

<link href="<?php bloginfo('stylesheet_url'); ?>" rel="stylesheet">

If it helps, I'm learning from this tut: https://www.youtube.com/watch?v=DJrGP9X2_bQ

Thank you :)

  • What do you mean by "reload the theme"? – Jacob Peattie May 10 '18 at 2:35
3

The proper way to add a style, as in a template or in a theme, is to use the wp_enqueue_style function. See https://developer.wordpress.org/reference/functions/wp_enqueue_style/ .

One of the parameters in the function is a version number, which you can change if you make changes to the CSS in the file. That will force WP into loading the new version, and not to use a cached version of the file.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.