For a website I am developing I have to create two pages with listings of courses. The first page is a "Trainings" page while the other page is "Coaching". I would like to use a single custom post type for the content of the courses, because this will be the same for the all the courses on the Trainings and Coaching listings.

I also need to assign each courese to a sub category. These sub categories will only be used to display the courses in separate columns on the Trainings and Coaching pages, but the user should be able to specificy the sub category for each course, however, a course should only be allowed to have a single sub category.

The URL structure I would like to have is the following:

Trainings > Training category 1 > Training one ==> /trainings/training-one

Trainings > Training category 2 > Training two ==> /trainings/training-two

Coaching > Coaching category 1 > Coaching one ==> /coaching/coaching-one

Coaching > Coaching category 2 > Coaching two ==> /coaching/coaching-two

I am new to Wordpress so I would like to know what would be the correct Wordpress way to go about this.

1 Answer 1


There are several ways to set this up. I´ll explain how I would do it, using as much of WordPress default settings and functionality to keep things simple.

Post Types

I´d start with creating 2 custom post types: trainings and coaching. The name of the post type will be added to the URL, so now your courses are accessible via:



To group the courses together you can create custom taxonomies.

You didn´t specify how you want to order these posts and if the taxonomies are the same for both courses but let´s say you want to order all trainings courses by level: beginner, intermediate and advanced.

In that case you could create the taxonomy level containing the 3 terms: beginner, intermediate and advanced.

When you register the taxonomy you can specify which post types can use this taxonomy and what the URL should look like.

Use something like this:

 register_taxonomy('levels', array( 'trainings' ), array(
    'hierarchical' => false,
    'labels' => $labels,
    'show_ui' => true,
    'update_count_callback' => '_update_post_term_count',
    'query_var' => true,
    'rewrite' => array( 'slug' => 'trainings/level', 'with_front' => false ),

to generate URL´s like this:

example.com/trainings/level/beginner      // taxonomy archive of all beginner courses
example.com/trainings/level/intermediate  // taxonomy archive of all intermediate courses
example.com/trainings/level/advanced      // taxonomy archive of all advanced courses

Note that WordPress needs the name of the taxonomy (level) to distinguish a taxonomy from the course post type.

I hope this helps. Also as said before, I´m sure there are more ways to approach this.

  • Ok thx for your input. But an approach with a single custom post type is not possible? Or is this just the easiest way to implement it?
    – Jan-Henk
    Aug 9, 2012 at 16:04
  • Sure, a single CPT is possible, but then you´d end up with URLs like example.com/category/trainings/postname. You can remove the category prefix with a plugin, but I´m not sure how to add the taxonomies under the categories. Maybe it´s easy, just never tried it that way.
    – Mattvic
    Aug 9, 2012 at 16:17
  • I took the two custom post types approach.
    – Jan-Henk
    Aug 13, 2012 at 11:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.