Tell me more ×
WordPress Answers is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I want to have a very specific post "type". I would like to get rid of the title and content box, and add a "Name" field and an "Age" custom field. This way when I go to create a new post, it's like creating a new "person" With their name and age. I'm trying to do this, so that I can hopefully use a JSON api plugin so that I can feed this into a JSON api for myself. Any suggestions?

share|improve this question
2  
My first suggestion would be to read this: The Complete Guide to Custom Post Types – Ben Miller Jul 29 at 3:57
add comment (requires an account with 50 reputation)

2 Answers

I would add my Custom Post Type (Person).

You can do this with register_post_type function.

Then you have to add your custom fields. And the easiest way to do this will be Advanced Custom Fields plugin.

It allows you to define additional custom field groups that will be added to posts (based on some rules). It also allows you to hide parts of default WordPress editor.

share|improve this answer
add comment (requires an account with 50 reputation)

Yu can use the folowing code for creating a custom post type

function create_post_type()
{
    register_post_type('Custom_post_type_1',
                        array(
                             'labels' =>
                                    array(
                                            'name' => __('Games'),
                                            'singular_name' => __('Game')
                                        ),
                                    'public' => true,
                                    'menu_position'=> 5,
                                    'rewrite' => array(
                                                'slug'=>'CPT1'
                                                ),
                                    'support' => array('comments','author')
                                    )
                                );
}
add_action('init','create_post_type');
share|improve this answer
add comment (requires an account with 50 reputation)

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.