0

I have a custom post type "listings" and I have created a custom taxonomy "listings_category".

Everything works fine except Hierarchical URLS for the taxonomy.

For instance, for standard hierachical wordpress categories we would see:

http://www.domain.com/category/tv/video/

So I want my custom taxonomy to look like this:

http://www.domain.com/listing-category/tv/video/

But wordpress seems to leave out the parent term from the URL, leaving me with:

http://www.domain.com/listing-category/video/

Here is the code I've used to create the taxonomy:

add_action('init', 'create_taxonomies', 10);
function create_taxonomies(){

    register_taxonomy(
    'listing_category',
    array('listings'),
    array( 
      'hierarchical' => true,  
      'label' => __('Category'),
      'sort' => true,
      'args' => array('orderby' => 'term_order'),
      'rewrite' => array('slug' => 'listing-category'),
    )
  );   

}

1 Answer 1

0

Try this plugin Hierarchical URLs

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.