Skip Navigation

[Resolved] Assign post to a taxonomy term instead of cpt-category

This support ticket is created 4 years, 11 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

Author
Posts
#1242597

Currently I have a Custom Post Type called "Vehicle". For each generated post I get a subpage which gets a prefix via functions.php.
So if I create the post "A5" I get (after the system inserted the prefix "Audi-") the following URL: domain.com/vehicle/audi-a5/

In addition, I have created a custom taxonomy called "location" which allows me to display countries, regions and cities using subcategories. My post in the custom post type "Vehicle" is assigned to a corresponding area.

But now I have a case where I need all posts of a custom post type not in the category "Vehicle" but attached to the taxonomy to which the post was assigned.

So the A5 Post should not be so
domain.com/vehicle/audi-a5/

but in such a way that the
domain.com/location/region1/audi-a5/
or
domain.com/location/region1/city1/audi-a5/

How can something like this be implemented?

Thanks in advance.

#1242881

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

Well - this is a pure question where you need to rewrite the permalinks as per your need.

Types support one option to rewrite the post type slug. There is a rewrite option available with CPT:
=> Edit your post type
=> Navigate to "Options" section
=> Under Rewrite option - click on "Use a custom URL format" and you can add your custom slug there.
=> Using this option you can add the static prefix to your URL but not dynamic

To change permalinks to your described structure will need custom programming and that is unfortunately out of the scope of our support policy. If you need custom programming work with your project, please feel free to contact our certified partners:
=> https://toolset.com/consultant/

I suggest you should find some plugin that may help you:
=> hidden link
OR
You can take some idea from the following links:
=> http://wordpress.stackexchange.com/questions/108642/permalinks-custom-post-type-custom-taxonomy-post
=> http://stackoverflow.com/questions/23698827/custom-permalink-structure-custom-post-type-custom-taxonomy-post-name
=> hidden link
=> http://code.tutsplus.com/articles/using-wordpress-for-web-application-development-available-features-part-6-url-rewriting-or-routes--wp-34326

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.