WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have custom post type called paintings and it has a custom taxonomy called paintings_category.

Currently I have this situation:

  • example.com/paintings/

    A page using page-paintings.php

  • example.com/paintings_category/landscape/

    Lists all landscape items in taxonomy.php

  • example.com/paintings/landscape/painting-title/

    Displays single painting post types, eg. single-paintings.php

If I try changing the slug as below, I get a 404 error on:


    'paintings_category', array('paintings'), 
        'hierarchical' => true, 
        'label' => 'Categories', 
        'singular_label' => 'Category', 
        'rewrite' => array( 'slug' => 'paintings' )

I'd like behaviour to be:

  • example.com/paintings/

    ideally list paintings_category as links

  • example.com/paintings/landscape/

    lists all items of landscape taxonomy

  • example.com/paintings/landscape/painting-title/

    displays single item

Any thoughts on how I can achieve this?

I tried adding paintings as a parent of landscape category in paintings_category but this still leaves me with a 404 on the single.

share|improve this question
Simply put, you can't have pages, a custom post type and a taxonomy all share a common URL, that's simply beyond what the rewrite rules are capable of handling. Put it this way, if i request example.com/paintings/something, how could WordPress know if i'm referring to a page, a post type or a taxonomy? (it can't). – t31os Mar 30 '11 at 13:03
I realised there are conflicts in trying to get that structure the way I have it currently, but I was hoping to do it another way. Can I have a taxonomy hierarchy thus: /paintings/landscape/painting-title/ and not have a page called 'paintings' is that possible? if so how should I go about it? – Andy Mar 30 '11 at 14:26
up vote 1 down vote accepted

Well, it turns out it is indeed possible : )

I eventually found most of the answer in this post: Custom post types, taxonomies, and permalinks.

Then I got single-paintings.php to paginate within selected taxonomy with this plugin: Ambrosite Next/Previous Post Link Plus (which looks like it could be dropped into functions.php if you wanted to do it without plugins).

Hope this helps someone!

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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