• Basically I want to create a hierarchy of categories for my pages. So for example:

    Conferences Page
    (This page will show links to each category inside the Conferences. Example: 2015 Conferences, 2016 Conferences, 2017 Conferences.)

    Conference Category Page
    (This will display links to the posts inside of this category.)

    Single Conference Page

    You can see an example here: https://xd.adobe.com/view/00fd08f8-f676-463f-adf2-3cdf0b74ecd9/

    What would be the best way to achieve this in WordPress?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Moderator bcworkz

    (@bcworkz)

    You could go either way. Regular posts are not hierarchical, but pages are. Of course custom post types can be hierarchical. Categories are hierarchical, but tags are not. Of course custom taxonomies can be hierarchical.

    The main difference between organizing by post type vs. by taxonomy is you can only publish a single post with a particular slug. You can publish any number of posts with a particular taxonomy term applied. If you can get by with a single post per conference, organizing by post hierarchy would be simpler. Organizing by taxonomy is more complicated, but you have more flexibility.

    Thread Starter Chudz

    (@chudz)

    Thanks!

    So far I have done the following:

    Created a custom post type called: Conferences
    Created a custom taxonomy called: Years
    I have attached Years taxonomy to Conferences custom post type.

    I have then created a template file archive-conferences.php and removed the normal loop and replaced it with some code that produces a list of terms from the Years taxonomy which you can click to take you to that terms posts.

    Now I need to figure out how to show the custom taxonomy Years in a sidebar widget similar to the way Archives and Categories show in the default themes. I also need this widget to only show the custom taxonomy Years when looking at the Conference post type.

    Anyone got any ideas ? ??

    Thanks

    Moderator bcworkz

    (@bcworkz)

    I would start by copying one of the default widget codes from wp-includes/widgets.php, renaming it, and altering it to work with your taxonomy. You can determine what is in the main content area by calling get_queried_object() and examining the post_type query var.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Custom Post Types or Custom Taxonomies or Both?’ is closed to new replies.