Created
August 22, 2013 20:47
-
-
Save JoshFialkoff/6312587 to your computer and use it in GitHub Desktop.
This produces a 301 redirect based on an Advanced Custom Fields drop down list of site pages (or posts if you want). It works great with the Genesis Responsive Slider to allow editors to have a marketing message link to a product or service page.
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 for slide pages */ | |
add_action('template_redirect', 'slide_template_redirect', 1); | |
function slide_template_redirect(){ | |
if ( in_category('homepage-slider') ) { | |
if(get_field('landing_page')){ | |
wp_redirect( get_field('landing_page'), 301); | |
exit; | |
} | |
} | |
return; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment