Support » Plugins » Hacks » Custom Post Type for TV Shows, Seasons, Episodes

  • I am trying to create a hierarchical post type as Series which flows like this: Parent ( Tv Show Name, eg X-Files ), Child ( Season 1 ), Grand-child ( Episode 1 – Pilot ) So on
    (Tv Show)post-parent->(Tv Show Season)category-child->(Tv Show Episode)posts-grand-child?

    – Series: Name,Title,Description (Parent post)
    — Season 1 (child category?)
    — Episode 1 (grand child post)
    — Season 2 (child category?)
    — Episode 1 (grand child post)

    But have no idea how custom post types works with this NOR how to make post type as “child” and “grand-child” or even parent? I want help with a template to display it

    Some similarity to this code.. But have no clue how to setup a custom post as parent:
    http://pastebin.com/m78DESL8

Viewing 11 replies - 1 through 11 (of 11 total)
  • Thread Starter ZaddKeefer

    (@zaddkeefer)

    How can I use register_post_type() and set hierarchical to true (default: false). with the rewrite argument > with_front to prepend /series/ ?

    I really need help on all this, thanks in advance

    Thread Starter ZaddKeefer

    (@zaddkeefer)

    Can someone please help me with this?

    Joey

    (@leglesslizard)

    Hey,

    Sounds quite complex but maybe this is what you’re after?

    Personally, I’d be looking at custom taxonomies rather than handling it all through the post types I think. Maybe create a custom post type for episodes and a series->series-season-number type structure for taxonomies. I am a lot more familiar with taxonomies than hierarchical post types however :p but this way each episode would be tagged with its parent season and grandparent? series.

    Good luck!
    Joey

    Thread Starter ZaddKeefer

    (@zaddkeefer)

    Thanks for the respond Joey.. Really! I only know how the standard of “templating” a wordpress theme, and this seems a bit more complex than I know of :p

    If you are familiar with taxonomies, I might go with that? If you know a way how to put it all together.. I want a post to be a parent of another and those childs (however you talk about tags) This might works as well, even though I used tags as (comedy, horror, etc) and categories with (series, episodes and seasons)

    If you got a solution to get this to work under a certain parent-post (even with a tag) then I just exclude the tags(genres) in the certain parent-post

    I just really want an easy solution to post “child-posts” to a parent-post

    😀 Hope you can help

    And your link might work.. But have no clue how to “echo” all the child-posts on a parent-posts, that I need help with

    Joey

    (@leglesslizard)

    Well, hopefully someone with a bit more experience than me will chime in and give you a simple solution.

    My response was due to work I’ve done on shop sites where, for example, we have a post type of products and then various categories:

    - Books
        - Authors
            - Author 1
            - Author 2
        - Genre
            - Genre 1
            - Genre 2
    - Music
        - Artists
            - Artist 1
            - Artist 2
        - Genre
            - Genre 1
            - Genre 2
    etc etc

    This is all managed by categories and then within the templates you have control over what to display. An archive page for music (for example) could provide a dropdown filter with artists,genre etc and the sub categories could be shown dependant on the selection.

    I know it can all be managed this way but whether this is the best way to go about it I’m not 100% sure

    Thread Starter ZaddKeefer

    (@zaddkeefer)

    Well it’s sort of that I want, but how does I make the query on single.php.. For instance if the post is “South Park” details bla bla bla. and under all this I want to list Seasons(Categories) and Episodes(Posts from Episodes) but related to the main post

    – Series
    — South Park
    Main Post (of South Park Category)
    — Episodes
    Episode Post (of Episodes Category)
    — Seasons (Parent-Category)
    —- Season 01 (Child-Category)
    —- Season 02 (Child-Category)

    I guess it would be something like that.. The problem is I have no idea how to make a query for this? Where on Main Post, I want to query so it echo seasons and episodes under the main post

    If that makes any sense at all, thanks for putting your mind to this!

    Joey

    (@leglesslizard)

    Always think “is there a wordpress function for that?” 🙂 Don’t try and do stuff that’s already done for you! See here.

    There are so many options with this function I find it hard to believe you couldn’t get exactly what you wanted with it. Pay particular attention to the “Only Show Children of a Category” example as I believe that is what you are describing above.

    Thread Starter ZaddKeefer

    (@zaddkeefer)

    Yes that function might do the job, but I have no clue to use it for my advantage, of course I might use of child_of=8 (lets say its south park) What when I make another “main post” (lets say spiderman) with categories attached to that as well, like so

    – Series
    — South Park
    Main Post (of South ParkCategory)
    — Episodes
    Episode Post (of Episodes Category)
    — Seasons (Parent-Category)
    —- Season 01 (Child-Category)
    —- Season 02 (Child-Category)
    — Spiderman
    Main Post (of South Park Category)
    — Episodes
    Episode Post (of Episodes Category)
    — Seasons (Parent-Category)
    —- Season 01 (Child-Category)
    —- Season 02 (Child-Category)

    Is there any dynamic way to fetch the cat id the main post has, to get the child category posts?

    I have no clue on how to code this, I might need an example to tweak it myself

    Thread Starter ZaddKeefer

    (@zaddkeefer)

    Also I want to list the posts within episodes on my main post, not only the categories

    Joey

    (@leglesslizard)

    If I was approaching this I would setup my categories how I wanted, add some test posts and see how it played out with my theme and adjust from there. I believe wordpress does a lot of the heavy lifting for you 🙂 for example if you create some categories, assign some posts to them and then use the “view category” link provided in the admin you may get a clearer view of how it plays out.

    The only posts will be episodes, the other content you would generate within the template. Check out the codex for info on returning categories dynamically but of course it can be done 🙂
    probably as simple as “get_the_category()”

    Thread Starter ZaddKeefer

    (@zaddkeefer)

    Yea you are right, even though my mind went through all of this 😉 Let me see if I can get it to work, even though my biggest problem would be the episodes POSTS, and that is certainly one of my biggest issues in this project..

    But thanks for your help indeed, will try and see how to categories works out.. 🙂

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Custom Post Type for TV Shows, Seasons, Episodes’ is closed to new replies.