• So as it says in the title.. I am Trying to make a Episode Guide List like IMDB. Let’s say you go under a post named like “Game of Thrones” I want to under that post.. to post all episodes/titles from a sub cat that has the same cat as the post “game of thrones” except the episodes post are in a sub category.

    Let’s say I go under the post “game of thrones” I want to get all sub categories listed.. such as the episode-posts, and the seasons-categories attached to those sub categories

    This might be a long SELECT from INNERJOIN/LEFTJOIN query?

    Hope you guys understand.

    Example:
    Post equal THE FLASH (title),
    get/post all post from child category of the post episodes(category) AND the child category seasons

    My example might be garbage.. But I want to show below the post/serie GAME OF THRONES:
    Season 1 : Episode 1
    Season 1 : Episode 2
    Season 1 : Episode 3

    and

    Season 2 : Episode 1
    Season 2 : Episode 2
    Season 2 : Episode 3

    All categories are categorized as:

    Series
    – Game of Thrones
    — Episodes
    – Seasons
    — Season 1
    — Season 2

    So every MAIN post got the category “game of thrones”, every episode got “game of thrones, episode and seasons”

    Any help appreciated

Viewing 1 replies (of 1 total)
  • Instead of Posts, you could use Pages which have a hierarchy structure. Or you could create a custom post type, and declare that it use a hierarchy structure.

    So without using categories, you could structure your pages exactly as you want them, and use get_page_children to get the sub pages.

    If you must use posts and categories, you could consider using a tax_query with $WP_Query. For example:

    $args = array(
    	'post_type' => 'post',
    	'tax_query' => array(
    		'relation' => 'AND',
    		array(
    			'taxonomy' => 'category',
    			'field'    => 'slug',
    			'terms'    => 'game-of-thrones',
    		),
    		array(
    			'taxonomy' => 'category',
    			'field'    => 'slug',
    			'terms'    => 'episodes',
    		),
    	),
    );
    $query = new WP_Query( $args );

    I hope i understood correctly. In the future, please consider posting advanced questions like this in the Hacks forum.

Viewing 1 replies (of 1 total)
  • The topic ‘I am Trying to make a Episode Guide List like IMDB’ is closed to new replies.