Created
July 27, 2016 08:44
-
-
Save reficedev/c5d0451124c74f0afc67c127ccaa582f 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
<?php | |
// à mettre dans /wp-content/themes/mon_theme-child/image.php | |
global $post; | |
if ( $post && $post->post_parent ) { | |
wp_redirect( get_permalink( $post->post_parent ), 301 ); | |
exit; | |
} else { | |
wp_redirect( home_url( '/' ), 301 ); | |
exit; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment