admin管理员组文章数量:1333710
I'm working on a client's website who requested that the custom search functionality I'm building out provide a number of 'pretty' permalinks that they can use for ad campaigns.
The post types I'm working with are community, floorplan, and ready-made homes, and they want to be able to have direct links to search results by county and community.
To achieve this, I set up taxonomies that would create nicely formatted URLS such as {county}/{community}, {county}/{community}/{floorplan} {county}/{community}/{ready-made}.
This is all working fine, however it leads to some issues. For example, If you do not specify a county in your search, you will get links like uncategorized/{community} returned in the results.
Is there any way that you can remove uncategorized taxonomy from the URL, but leave the taxonomy in if it exists?
I've figured out how to update the URLs in the search results, however they will lead to 404s if left completely empty because they technically don't exist if you remove the taxonomy from the url. Ideally, I would want them to just redirect to communities/{community} for example, instead of communities/uncategorized/{community}
本文标签: Possible to remove taxonomy from permalink if uncategorized
版权声明:本文标题:Possible to remove taxonomy from permalink if uncategorized? 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742265790a2443364.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论