Last active
June 21, 2022 11:24
-
-
Save diviengine/8cae0c00d33cab2c2f76c4cdac6b9d9f to your computer and use it in GitHub Desktop.
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 | |
add_action( 'template_redirect', 'de_redirect_single_template' ); | |
function de_redirect_single_template() { | |
if ( is_singular( 'cpt_slug' ) ) { | |
wp_redirect( home_url(), 301 ); | |
exit; | |
} | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment