kpetrowski
11/1/2018 - 6:10 PM

FacetWP - Category redirect to sorted facets archive


<?php // SERMON archive - 'Speaker' redirect
function sermon_archive_speaker()
{ if( is_tax( 'perelandra_sermon_speakers' ) )
    {
	    $term_slug = get_queried_object()->slug;
        wp_redirect( esc_url( add_query_arg( '_sermon_speakers', $term_slug, '/watchlisten/' ) ) );
        die;
    }
} 
add_action( 'template_redirect', 'sermon_archive_speaker' );


// SERMON archive - 'Series' redirect
function sermon_archive_series()
{ if( is_tax( 'perelandra_sermon_series' ) )
    {
	    $term_slug = get_queried_object()->slug;
        wp_redirect( esc_url( add_query_arg( '_sermon_series', $term_slug, '/watchlisten/' ) ) );
        die;
    }
} 
add_action( 'template_redirect', 'sermon_archive_series' ); ?>