admin管理员组文章数量:1122846
So basically I have a WordPress page called games. Within this page I have a list of custom post type posts. Using a form and some $_GET magic, the user is able to filter the posts based on tags, as well as, first letter in the title.
The base url for the page is: localhost/gamesite/games/
The URL for the filter looks like this: localhost/gamesite/games/?genre=audio-and-video&platform=ps3&alpha=A
The desired URL structure should look like this: localhost/gamesite/games/audio-and-video/ps3/?alpha=A
I'm looking to use the native WordPress API to set these rules, instead of hacking the htaccess file. After reading several posts, I am unable to create any working form of the desired URL structure. More importantly than having the end code, I would like to learn how this process works. Any help would be greatly appreciated.
So basically I have a WordPress page called games. Within this page I have a list of custom post type posts. Using a form and some $_GET magic, the user is able to filter the posts based on tags, as well as, first letter in the title.
The base url for the page is: localhost/gamesite/games/
The URL for the filter looks like this: localhost/gamesite/games/?genre=audio-and-video&platform=ps3&alpha=A
The desired URL structure should look like this: localhost/gamesite/games/audio-and-video/ps3/?alpha=A
I'm looking to use the native WordPress API to set these rules, instead of hacking the htaccess file. After reading several posts, I am unable to create any working form of the desired URL structure. More importantly than having the end code, I would like to learn how this process works. Any help would be greatly appreciated.
Share Improve this question edited Jul 2, 2011 at 9:34 Ramkumar M 8741 gold badge13 silver badges33 bronze badges asked Mar 3, 2011 at 21:39 Colin MorganColin Morgan 731 silver badge6 bronze badges 1- I would try to make it work with mod_rewrite rules in .htaccess. Is that an option? – Wietse Venema Commented Mar 5, 2011 at 20:16
1 Answer
Reset to default 0Here's a nice explanation of how rewriting is done in WP:
http://ottopress.com/2010/category-in-permalinks-considered-harmful/
Also, might want to take a look at similar questions:
Writing Custom Rewrite Rules that Incorporate Category for Custom Post Types?
本文标签: Custom rewrite rules for a page with GET variables
版权声明:本文标题:Custom rewrite rules for a page with GET variables? 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736289316a1928278.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论