0

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?

1

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,
        )
    );
}
6
  • 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? – hacksy 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 – hacksy 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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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