1

Let's suppose I have CPT "event". In register_post_type, I've set

'slug' => 'event'

Then, in Wordpress settings I've set following Permalink structure

Custom: http://www.domain.tld/news/%postname%/

The problem is, URL for my "Event" CPT is

www.domain.tld/news/event/<event-name>

and I want

www.domain.tld/event/<event-name>

how can I achieve that?

Thanks

1 Answer 1

2

Use the argument:

'rewrite' => array(
    'slug' => 'event',
    'with_front' => false,
)

The 'with_front' flag controls whether to use the front part you've defined.

0

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.