Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Basically what I want is to create an EVENT post type. So people can put in a date and time of the event. (I've got this far... this is fine).

The bit that I can't seem to figure is now I want to be able to make pages as SUB PAGES of that meeting. I'm not really bothered how I do this to be honest, although I figured the easiest way would be to somehow extend the functionality of the standard wordpress pages to allow for EVENT posts to be their parents.

Each event will have the same sub pages, so each one will have "Venue, Travel, Agenda" etc.

Is there any way to do what I suggested, or perhaps a better way to get this functionality that I'm missing?

Thank you.

share|improve this question

2 Answers 2

up vote 2 down vote accepted

Unfortunately at the moment that isn't really possible. You can set up the posts manually or via a custom UI to have the right parentage, but the permalinks will not work, defeating the point. What's more even if it did work, after the first event, you'd have clashing permalinks, and wordpress would rename your second venue subpage to venue_2 to prevent collisions.

But there is an alternative means of getting exactly what you want! You can use custom endpoints to modify the rewrite rules so that you can have additional components to an events URL. You can then check for these in the events template and display something different.

See here for an in depth answer to another question about endpoints and how to use them:

Pretty URL with add_query_var

e.g.

add_rewrite_endpoint('venue', array(EP_NONE)); 

and in your theme template for events, probably single-event.php:

global $wpquery;
if(isset($wpquery->query_vars['venue'])){
     // display the venue stuff
} else {
    // display the normal event stuff
}

You can then add an editor for the venue etc to the events post type, and do an if statement in your events template checking for the endpoint ( as demonstrated in the link ), and display the custom field instead of the main event content.

share|improve this answer
    
Could I use that with custom meta? –  Thomas Clayson Nov 17 '11 at 17:52
    
Yes, yes you can –  Tom J Nowell Nov 17 '11 at 18:29
1  
Brilliant. Thank you. :) –  Thomas Clayson Nov 18 '11 at 11:50

It is possible to do that using the Types plugin. It lists all post types as potential parents or children when creating a new post type. They have information about their API on their website, though I have not looked under the hood myself at this point.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.