0

I have a Custom Post type "Data" with a custom Taxonomy "data-category".

Currently my site url when I visit a 'data-category' shows like this :

www.mysite.com/data-category/home-loan

Here Home-Loan is a child of Personal Loan data-category.

I need my url to show like this :

www.mysite.com/personal-loan/home-loan

Yes I need to get rid of 'data-category' from my url.

Thanks

2

1 Answer 1

2

Found the solution. By default wordpress doesn't show hierarchical URL for custom taxonomies.

Therefore while registering custom taxonomy, we must include the rewrite variable.

 $args = array(

        'rewrite'           => array( 'hierarchical' => true ),

    );
1
  • Still One problem remains though. I can't have same slug for different category childs. www.mysite.com/Personal/home-loan www.mysite.com/leasing/home-loan It is not possible as 'home-loan' slug can't be use twice. Looking to resolve it. May 12, 2014 at 12:00

Your Answer

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

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