Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@nutsandbolts
Last active November 9, 2017 06:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nutsandbolts/57173937861d0f5bc670 to your computer and use it in GitHub Desktop.
Save nutsandbolts/57173937861d0f5bc670 to your computer and use it in GitHub Desktop.
Daily Bolt: redirect single posts to articles
//* 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;
}
}
@Vhiktordom
Copy link

Hello Please where did you define the genesis_get_custom_field variable?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment