admin管理员组文章数量:1022997
Not sure how to ask this, because I'm not exactly sure what I'm asking.
I'm looking to use custom URLs (using rewrite rules maybe?) to create 'tabs' for a Custom Post Type. In the past I've used things like a GET session variable to determine what tab the user is on, or JavaScript. I would really prefer to keep it on it's own logical page with a URL to reflect that.
A very basic look of the tabs would be:
HOME | UPDATES | CONTRIBUTORS | WALL
For example if we're on the CPT of Charity's sub page of Updates: http://siteroot/charity/updates
Not sure how to ask this, because I'm not exactly sure what I'm asking.
I'm looking to use custom URLs (using rewrite rules maybe?) to create 'tabs' for a Custom Post Type. In the past I've used things like a GET session variable to determine what tab the user is on, or JavaScript. I would really prefer to keep it on it's own logical page with a URL to reflect that.
A very basic look of the tabs would be:
HOME | UPDATES | CONTRIBUTORS | WALL
For example if we're on the CPT of Charity's sub page of Updates: http://siteroot/charity/updates
1 Answer
Reset to default 1Create an end point for the permalinks. See example.
Then you can even be more granular and use updates/2012
, updates/2013
and so on.
Recommended reading:
- Codex:
add_rewrite_endpoint()
- A (Mostly) Complete Guide to the WordPress Rewrite API
Not sure how to ask this, because I'm not exactly sure what I'm asking.
I'm looking to use custom URLs (using rewrite rules maybe?) to create 'tabs' for a Custom Post Type. In the past I've used things like a GET session variable to determine what tab the user is on, or JavaScript. I would really prefer to keep it on it's own logical page with a URL to reflect that.
A very basic look of the tabs would be:
HOME | UPDATES | CONTRIBUTORS | WALL
For example if we're on the CPT of Charity's sub page of Updates: http://siteroot/charity/updates
Not sure how to ask this, because I'm not exactly sure what I'm asking.
I'm looking to use custom URLs (using rewrite rules maybe?) to create 'tabs' for a Custom Post Type. In the past I've used things like a GET session variable to determine what tab the user is on, or JavaScript. I would really prefer to keep it on it's own logical page with a URL to reflect that.
A very basic look of the tabs would be:
HOME | UPDATES | CONTRIBUTORS | WALL
For example if we're on the CPT of Charity's sub page of Updates: http://siteroot/charity/updates
1 Answer
Reset to default 1Create an end point for the permalinks. See example.
Then you can even be more granular and use updates/2012
, updates/2013
and so on.
Recommended reading:
- Codex:
add_rewrite_endpoint()
- A (Mostly) Complete Guide to the WordPress Rewrite API
本文标签: url rewritingHow to create custom URLs for Custom Post Type sub sections
版权声明:本文标题:url rewriting - How to create custom URLs for Custom Post Type sub sections? 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://it.en369.cn/questions/1745579260a2157211.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论