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 have a problem using the register_post_type and register_taxonomy on my Wordpress. I created the code on my functions.php and it does not update my panel. Why?

//Categorias personalizadas
register_taxonomy('produtos', 'produto', array('hierarchical' => true, 'label' => 'Categorias de Produtos', 'query_var' => true, 'rewrite' => true));
//Posts personalizados
add_action('init', 'create_post_type');
function create_post_type() {
    register_post_type('produto',
    array(
        'labels' => array(
        'name' => __('Produto'),
        'singular_name' => __('Produto')),
        'public' => true,
        'rewrite' => true,
        'supports' => array('title','editor','author','thumbnail','excerpt','comments','custom-fields','image'),
        'has_archive' => true)
    );
}
share|improve this question
    
You sure you added it to the correct functions.php? –  Hameedullah Khan May 16 '11 at 3:16
    
a copy/paste of your code works for me, your error is elsewhere. –  Milo May 16 '11 at 3:18
    
did you add it to the functions.php of the active theme? –  supajb May 16 '11 at 4:31
add comment

1 Answer 1

up vote 3 down vote accepted

I copy pasted your code into my functions.php and it worked for me, make sure you are using a recent version of WordPress that supports Custom Post Types

share|improve this answer
add 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.