Skip to content

Instantly share code, notes, and snippets.

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

This comment has been minimized.

Copy link

@Vhiktordom Vhiktordom commented Nov 9, 2017

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