我在本地计算机中运行wordpress 4.2,此时,所有一切都很好,我只是想创建一个wordpress模板,我有index.php,header.php,ploter。php,sidebar.php,style.css,single.php,functions.php and category.php
但是,当我单击帖子类别链接时,问题出现了,我得到http://localhost/wordpress/index.php/category/music/我找不到文件,而不是Local -Host/wordpress/category/music/with the with the以该类别发布。
我在category.php上有循环,但它没有加载类别。php我不知道为什么,WordPress似乎正在尝试在index.php中找到类别,而不是从 category.php
如果有帮助,请尝试这些解决方案
1)将永久链接结构更改为默认为检查
或
2)在root上创建一个.htaccess
文件,然后插入此代码
您的.htacces文件看起来像这样:
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /name_of_your_wordpress_installation_folder/
RewriteRule ^index.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . index.php [L]
</IfModule>
# END WordPress