• I have a page with the slug ‘nursery’ (/all-classes/nursery/), and also have a custom taxonomy term ‘nursery’ (/class-blog/nursery/).

    When I use get_term_link, it gives me what I want: a link to /class-blog/nursery/.

    But on clicking that link, I’m always redirected to /all-classes/nursery/.

    That’s probably because of the trailing ‘nursery’, but it’s not correct and I wondered if anyone out there knows how to fix that. Flushing my permalink rules did not work.

    Also, I need the page slug to be the same as the taxonomy term slug.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Moderator bcworkz

    (@bcworkz)

    This has to do with the ‘with_front’ parameter being set to true for the rewrite argument of the register_taxonomy() call used when you register the all-classes taxonomy. You should get the proper behavior by setting it to false.

    I can’t explain why, I don’t really understand what this parameter actually does. I observed the same issue as you and this fixed it. I haven’t noticed any untoward side effects from doing this, but I haven’t really tested the site since the change.

    Thread Starter Wabsnasm

    (@wabsnasm)

    Thanks, I’ll give it a go and report back.

    Thread Starter Wabsnasm

    (@wabsnasm)

    Nope, did not work.

    So, back to square one. Anyone else got any ideas how I can tackle this?

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Page slug same as term slug always redirects’ is closed to new replies.