Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<?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