Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I've got a wordpress website and i need to hide for the moment some custom post type.

I want to hide it because we will need it later.

How do I do it?

share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

There is a parameter named "public" where you can set if you want the custom post type to be private or public

add_action( 'init', 'create_post_type' );

function create_post_type() {
    register_post_type( 'acme_product',
        array(
            'labels' => array(
                'name' => __( 'Products' ),
                'singular_name' => __( 'Product' )
            ),
        'public' => false,
        'has_archive' => true,
        )
    );
}
share|improve this answer
    
Hi Hansy, thanks for your response. Does this work with the existing custom post type? How should I use this function? where should I run it? Sorry, I'm not familiar with wordpress. Thanks –  Tyler Durden Aug 23 '12 at 15:03
    
Hello Syd, well, how are you adding these custom post types? I think you may be using a plugin? –  Hansy Schmitt Aug 23 '12 at 15:06
    
They are already there. I need to hide it for a while, there is no plugin. –  Tyler Durden Aug 23 '12 at 15:07
    
Ok, so i guess is added using the theme, you may need to check your functions.php file within the theme, and look and any line that containts register_post_type –  Hansy Schmitt Aug 23 '12 at 15:12
    
Sorry Hansy, there is not this function inside function.php in the theme folder. What can i do? –  Tyler Durden Aug 23 '12 at 15:35
show 1 more comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.