Last active
November 9, 2017 06:14
-
-
Save nutsandbolts/57173937861d0f5bc670 to your computer and use it in GitHub Desktop.
Daily Bolt: redirect single posts to articles
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
//* Redirect posts to original URL | |
add_action( 'template_redirect', 'nabm_original_post_redirect' ); | |
function nabm_original_post_redirect() { | |
if ( ! is_singular() ) { | |
return; | |
} | |
if ( $url = genesis_get_custom_field( 'rss_pi_source_url' ) ) { | |
wp_redirect( esc_url_raw( $url ), 301 ); | |
exit; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello Please where did you define the genesis_get_custom_field variable?