[wp-hackers] child pages of custom post listing pages
steve at sltaylor.co.uk
Sun Jan 2 15:03:21 UTC 2011
I've got a custom post type "campaign". Using the rewrite parameter of
register_post_type, I've set the slug to "campaigns". All good so far
- the URL for a campaign is:
However, I've created a page with the slug "campaigns" to act as a
listing page for campaigns. We also need a child page of this page
with generic information on campaigns, e.g.
Viewing this page returns a 404.
Obviously it's related to http://core.trac.wordpress.org/ticket/13818
- which is coming in 3.1, right? If I've understood this feature,
it'll negate the need to create a page called "campaigns" as I've
done. The /campaigns/ URL will automatically load a template that'll
list that post type in some way.
But I'm guessing this feature will mean that I won't be able to have
generic pages at the same level as a campaign. I would need to have
campaigns with this URL:
But my info page would have to be something like:
And in terms of how the site structure and nav appears to the user,
I'd have to "fake" the above page being in the campaigns "section"?
Am I looking at custom rewrite rules to have my cake and eat it?
More information about the wp-hackers