Skip to content

Instantly share code, notes, and snippets.

View JoshFialkoff's full-sized avatar

Josh Fialkoff JoshFialkoff

View GitHub Profile
@JoshFialkoff
JoshFialkoff / gist:6312587
Created August 22, 2013 20:47
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.
/* 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;