admin管理员组文章数量:1122846
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:
Thank you :)
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 :)
Share Improve this question asked May 10, 2018 at 2:33 EzequeilEzequeil 11 silver badge1 bronze badge 1- What do you mean by "reload the theme"? – Jacob Peattie Commented May 10, 2018 at 2:35
1 Answer
Reset to default 4The 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.
本文标签: phpWordpress stylecss not updatingonly after theme reload
版权声明:本文标题:php - Wordpress style.css not updating, only after theme reload 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736292397a1928924.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论