D
D
Denis Kiselev2020-05-27 17:20:56
WordPress
Denis Kiselev, 2020-05-27 17:20:56

How to set custom taxonomy url?

Greetings.
1. there is a custom post type news
2. it has a category_news taxonomy
3. the link to the news category now looks like this: site.ru/category_news/category_name
Question: how to change the url to site.ru/news/category_name
---
/category_news /category_name -> /news/category_name

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
Pavel Ataykin, 2020-05-27
@pavel_ataykin

Hey! You need to use rewrite for the "category_news" taxonomy.
In your case, there will be a rewrite => ["slug" => "news"] argument
You can read more about this here: https://wp-kama.ru/function/register_taxonomy#rewrite

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question