Skip to content

Instantly share code, notes, and snippets.

Avatar

Josh Fialkoff JoshFialkoff

View GitHub Profile
@JoshFialkoff
JoshFialkoff / gist:6312587
Created Aug 22, 2013
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.
View gist:6312587
/* 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;
You can’t perform that action at this time.