Automatically redirect a page to a category that share the same slug
Well you can just turn the code 180 degrees from the linked question and problem solved. Just kidding. I would start with getting the current page slug, using that slug search for a category that has that slug, if found, redirect to it add_action(‘template_redirect’, ‘bt_redirect_page_to_category’); function bt_redirect_page_to_category () { // if we are not in … Read more