Last active
November 8, 2022 21:18
-
-
Save runezero/a6e1d6a93442a871d5b7c7750f7a6c3b to your computer and use it in GitHub Desktop.
[Redirect from category] If on category page, redirect to the home page #wordpress
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /* Register template redirect action callback 24-05-2019 */ | |
| add_action('template_redirect', 'code_remove_wp_archives'); | |
| /* Remove archives */ | |
| function code_remove_wp_archives(){ | |
| //If we are on category or tag (data and autheur is done via YoastSEO) | |
| if( is_category() || is_tag() ) { | |
| wp_redirect( home_url()); | |
| } | |
| } | |
| ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment