Wordpress rewrites rule with custom taxonomy and custom post type

I have a custom post_type called "video" and custom taxonomy "feeds"

I want to rewrite my page with detailed videos:

http://example.com/funny/<postname>

here "funny" is the term for channels.

I tried code like:

add_permastruct( 'video', '%channels%/%video%' );

It works fine, but when I try to open the details page, whose permalink is:

http://example.com/<parent_category>/<postname>

he does not work. All messages on page 404.

Please help me.

+4
source share
1 answer

you must achieve the result by setting the overwrite property in the message type definition:

ct_video

id → ct_channels

cutom :

'rewrite' => array('slug' => '[custom url]')

URL . : https://wordpress.org/plugins/custom-post-type-permalinks/ :

enter image description here

post

0

Source: https://habr.com/ru/post/1672542/


All Articles