Created by Alexandr Kostyrka 2016-08-11 View revision File functions-child.php Added Side-by-side diff More Ignore whitespace Hide word diff +// Redirect to custom portfolio page instead of archive page. +function archive_to_custom_archive() { + if( is_post_type_archive( 'portfolio' ) ) { + wp_redirect( home_url( '/portfolio/' ), 301 ); + exit(); + } +} +add_action( 'template_redirect', 'archive_to_custom_archive' );