• Old

    (@zilli)


    Hi. The following code https://gist.github.com/chrismccoy/8825664 will produce a url like:
    domain.com/videos/funny/cute-dogs/

    What I need is:
    domain.com/funny/cute-dogs/

    So, I thought that if I just remove the videos/ part from the CPT rewrite slug, it would works. But it doesn’t. Once I remove the videos/ form the slug, everything goes 404. What do i do?

Viewing 5 replies - 1 through 5 (of 5 total)
  • Oz Ramos

    (@labofoz)

    Whenever you programmatically change the rewrite rules, you’ll need to “flush” out the rules that were previously used.

    To do this, visit the permalinks page and just click save. Ie) Settings > Permalinks

    If that didn’t work at all, let me know, it might be something else.

    Thread Starter Old

    (@zilli)

    Yeah, I’m aware about the flush. Unfortunately it is not that.

    Oz Ramos

    (@labofoz)

    How about if you set with_front to false on line 24, and flush again?

    Thread Starter Old

    (@zilli)

    Nop. Once you remove the CPT base, only posts from the CPT works. Everything else gets 404.

    Thread Starter Old

    (@zilli)

    Any ideas please?

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Post Types with custom Rewrite Slug give 404’ is closed to new replies.