I'm struggling with the structure of my Wordpress site and I was hoping you might be able to give me some advice.
The site is for a series of events and the structure is as follows:
- Gateway (contains a list of events)
- London 2012 (a specific event)
- Overview (default for event)
- Speakers
- Agenda
- Venue
- Register
- New York 2012
- Overview
- Speakers
- Agenda
- Venue
- Register
- London 2012 (a specific event)
I am using several custom post types, and each have a number of custom fields attached:
Events: the information from this custom post type is used to create the Overview page Speakers: this a pool of the potential speakers. Speakers are added to a specific event using the above custom post type Venue: this is a pool of potential venues. The venue is added to a specific event using the above custom post type
I would like the structure of the site to be as follows:
- / - Gateway
- /london-2012/ - A specific event overview
- /london-2012/speakers - Speakers page
- /london-2012/agenda - Agenda page
- /new-york-2012/speakers - Another speakers page
- etc.
…where an identical page 'types' (eg. speakers page) will all use the same template across the board (I'll just get the parent event from the URL and do a custom query to grab the data for the page).
Can anyone suggest the best way to do this? I believe either a URL rewrite solution or categories may work but I'm unsure about both :(
Update 1
Have sorted this using redirects - for example, speakers pages:
add_rewrite_rule(
'^event/([A-Za-z0-9-]+)/speakers/?$', //Checked against the global $wp object - $wp->request
'index.php?page_id=9&event_slug=$matches[1]', //Use WP_Query params to find your page
'top' //This will superceed the default WP rewrite stack
);
then registered the variable:
add_filter('query_vars', 'my_query_vars');
function my_query_vars($vars){
$vars[] = 'event_slug';
return $vars;
}