I want to make a TV Show database in WordPress that has this URL format:
/tvshows/friends/01/12/
/tvshows/
would list all series/tvshows/friends/
would list all the seasons available for Friends TV Show/tvshows/friends/01/
would list all episodes of Friends from season 1/tvshows/friends/01/12/
would show information on the 12th episode of the first season
And here are the different methods I’ve thought about:
1) The first idea that came to my mind is to create Pages and nest them accordingly. Then create 3 different page templates (TVShow.php, Season.php and Episode.php) and style each page accordingly. The main drawback is that once there are 200 series with 4 seasons and 25 episodes each (total of 20,000 pages) it can be a complete mess to update and find everything.
(Another drawback is the RSS feed although this can be solved through plugins)
2) Some colleagues suggest me to use Custom Posts but these do not have a hierarchical structure and although I could then use mod_rewrite to make the URLs nice I guess it would be even more hassle than using Pages. (There’s this plugin that manages custom posts through a UI although I cannot figure out how to create a hierarchical organization)
3) The last idea is to have them as normal Posts and then Categorize them by Serie name, season and episode hence avoiding all the custom post hassle and using simple WordPress API functions to list and display everything.
Those are the best/possible ways I can think of, the Page-based option may be the most suitable although scalable in a painful way once there are +500 pages.
Any ideas, suggestions on how to organize this?
Thanks in advance! 🙂
First, you shouldn’t do this with the built in post types of
post
orpage
. Use a custom post type.Use
register_post_type()
and sethierarchical
totrue
(default:false
). Take a look at therewrite
argument >with_front
to prepend/series/
.Then add some templates:
Justin Tadlock created a movie database using custom taxonomies that achieves something similar and he describes it in a tutorial here