5
votes

I have custom post_type called 'video' and custom taxonomy "channels"

I want to rewrite my video details page like this:

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

here "funny" is channels term.

I tried some code like:

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

It's working fine but when I'm trying to open post details page whose permalink structure is:

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

it's not working. All post single page show 404.

Please help me.

1

1 Answers

0
votes

you should achive your result customizing the rewrite property on your post type definition:

Custom Post type id -> video

video Custom taxonomy id -> ct_video

Custom Post type id -> channels

channels custom taxonomy id -> ct_channels

if you want to customize your custom post type or cutom taxonomy archive or page:

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

to personalize the url of your posts I advise you to download Custom Post Type Permalinks : https://wordpress.org/plugins/custom-post-type-permalinks/ and you can use it like this:

enter image description here

defining the custom post type post url using the structure tags