Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Jonathandejong

    (@jonathandejong)

    Hi,

    Depends on how you want to do this.
    You could just add the filtered url to your menu instead of a link to the unfiltered page.

    But I’m guessing you’re looking for something a bit more strict than that. Basically to completely remove the ability to visit the unfiltered page.

    You can achieve this by hooking into the template_redirect action in WordPress.
    https://codex.www.ads-software.com/Plugin_API/Action_Reference/template_redirect

    What you need to do there is check that you’re on the archive page BUT without any taxonomy parameters. I think you’ll have to do it using the global $wp_query rather than a is_term() check.

    So if that’s true, redirect to your chosen url.

    Thread Starter ekimbo

    (@ekimbo)

    Thanks.Much appreciated.

    Plugin Author Jonathandejong

    (@jonathandejong)

    No problem! Good luck with your project ??

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Default to a specific taxonmy instead of show all unfiltered posts’ is closed to new replies.