Skip to content

Instantly share code, notes, and snippets.

@chrdesigner chrdesigner/functions.php

Last active Jan 4, 2016
What would you like to do?
Set a custom post type to not show up on the frontend - WordPress
function chr_redirect_post_type() {
global $wp_query;
if ( is_post_type_archive('sliders') || is_singular('sliders') ) :
$url = get_bloginfo('url');
wp_redirect( esc_url_raw( $url ), 301 );
add_action ( 'template_redirect', 'chr_redirect_post_type', 1);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.