After Upgrading to High Sierra my localhost no longer worked. I followed a number of tutorials and finally got it to work but now my Wordpress sites load but do not load the CSS and Javascript files. When I check inspector it shows that it can not load the files because the directory is wrong. The address bar says localhost/Site-Name but the files are trying to be loaded from localhost/~paul/Site-Name so I must have messed up the configuration somehow.. Hopefully somebody can help. Thanks
相关问题
- Display product ACF field value in Woocommerce tra
- Stop .htaccess redirect with query string
- Adding a custom button after add to cart button in
- How to add a “active” class to a carousel first el
- Setting custom order statuses as valid for payment
相关文章
- wordpress新增页面如何个性化设置
- Apache+Tomcat+JK实现的集群,如果Apache挂了,是不是整个服务就挂了?
- select query in wordpress
- Get WooCommerce featured products in a WP_Query
- How reliable is HTTP_HOST?
- Woocommerce update shipping methods in checkout vi
- Making a two way SSL authentication between apache
- UnicodeEncodeError when saving ImageField containi
I found a workaround which while it does not fix my localhost not showing the Sites folder at localhost/~paul it does allow my Wordpress sites to work. I created a folder within my sites folder called ~paul and then moved all my sites into that. Now the CSS JS etc all load fine and I am happy with that.
Try calling your css file in the
header.php
like this:I had a similar problem and using
get_template_directory_uri()
allowed me to solve the it because in that case, the path given in Wordpress gets the files from the root directory.What happens if you
echo
thisget_template_directory_uri()
, it's supposed to show you the template dir something like: