简体   繁体   English

在服务器上安装后,WordPress不会加载CSS和JS文件

[英]WordPress doesn’t load css and js files after installing on server

After moving my local wordpress installation to my webspace, wordpress doesn't load css, js and some image files. 将本地wordpress安装移至网站空间后,wordpress不会加载CSS,JS和某些图像文件。 The page displays only text without any styling or functionality (see Click here ). 该页面仅显示没有任何样式或功能的文本(请参见单击此处 )。

What am I doing wrong? 我究竟做错了什么? Hope you can help me.. 希望你能帮我..

Proper way to import the css and js files 导入CSS和JS文件的正确方法

add_action('wp_enqueue_scripts', 'load_scripts', 12);
function load_scripts() {
    wp_enqueue_script('filename', get_template_directory_uri() . '/js/filename.js', array(), '1.0.0', true );


}

If the issues are with images make sure you hardcode properly. 如果问题出在图像上,请确保正确进行硬编码。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM