Forked from anonymous/WordPress disable the attachment page by redirecting
Created
October 23, 2015 08:11
-
-
Save goranseric/be78f57605dd5c3998c3 to your computer and use it in GitHub Desktop.
This file contains 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
if ( $post->post_parent ) | |
{ | |
wp_redirect( get_permalink( $post->post_parent ), 301 ); | |
} | |
else | |
{ | |
wp_redirect( site_url(), 301 ) ); | |
} | |
die(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment