patric-boehner
7/15/2016 - 7:42 AM

Redirect Custom Post Type Archive to Homepage

Redirect Custom Post Type Archive to Homepage

<?php
//* Do NOT include the opening php tag shown above. Copy the code shown below.

//* Redirect Featured Client Archive Page to Homepage
add_action('wp', 'pb_redirect_cpts');
function pb_redirect_cpts() {

    global $post;
    if( is_post_type_archive( 'featured_client' ) ){
        wp_redirect( home_url('/') );
		  exit;
    }
    
}