WordPress 类别和标签未链接
我不确定为什么这个问题会出现,在我做过的任何其他博客中都没有遇到过这个问题。但也许有人能够阐明这一点。
我有一个帖子列表。 标题|类别 | DATE
标题链接正确,但类别不正确。我用于显示类别的代码是:
<li class="category"><?php the_category(', ') ?></li>
当我单击类别链接时,它显示 404 not found 但出现 URL 问题:
http://domain.com/categoryName
应该
http://domain.com/category/categoryName
我确实有完全相同的问题标签,但我不知道标签功能的参考内容。
我将默认小部件用于“最受欢迎的标签”,但无论如何它都无法正确链接...并且它也具有以下网址:
如有任何帮助,我们将不胜感激。
I am not sure why this issue has risen up, never had this problem in any of my other blogs that I have done. But perhaps someone is able to shed some light on this.
I have a list of posts.
TITLE | CATEGORIES | DATE
The title links correctly, But the CATEGORIES do not. My Code for displaying the category is:
<li class="category"><?php the_category(', ') ?></li>
When I click the category link it displays 404 not found but there is a URL issue that comes in:
http://domain.com/categoryName
SHOULD BE
http://domain.com/category/categoryName
I do have the exact same issue with the TAGS but I don't know what to reference for the TAG feature.
I used the Default Widget for "most popular tags" and it just doesn't link properly no matter what... and it too has the url of:
Any help would be appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
函数
the_category()
只返回类别名称,你在哪里生成href?无论您在代码中的何处指定 url,您都应该能够添加/category/
。我需要查看更多代码才能更有帮助。另外, the_category() 将返回所有类别,因此如果您有多个类别,它可能会进一步破坏您的网址。同样,需要查看更多代码。
The function
the_category()
only returns the category names, where are you generating the href?. Wherever you're specifying the url in your code, you should just be able to add/category/
. I'd need to see more code to be more helpful.Also, the_category() will return all the categories, so if you have more than one category, it might screw up your url more. Again, would need to see more code.
很抱歉这篇文章,这是前一个主题作者的问题。
他删除了类别的代码。
Sorry about this post, it was an issue with the previous theme-author.
He removed the the code for the categories.