WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Am attempting to create a custom post type and have it contain very specific info. Name, address, city, state, zip and photo - as a post. Need to have the admin section show form fields named as what these items are. Yes, I could use custom fields, however want to do it right and setup form input boxes (or meta boxes) for each specific piece of data.

Having the post creation dialog have a specific file upload input for the photo would be pretty smooth.

Will use plugins if necessary, however would rather code it in, as it is very specific (and should stay that way).

Looking for suggestions or tutorials that would cover this specific need, or plugins that anyone has used that do this.

share|improve this question

migrated from stackoverflow.com Jan 12 '12 at 0:51

This question came from our site for professional and enthusiast programmers.

Hi What you need to do is add some code to your functions.php file within your theme..

ie: register_post_type()

this will generate a new area under the likes of media on your admin menu.. the way you set this up, will depend on what is enabled and visible on the post write/edit pages..

for instance this is a copy paste from a theme file i have, this generates a new video post type,

add_action( 'init', 'register_videos_post_type' );

function register_videos_post_type() {
    register_post_type( 'videos',
            'labels' => array(
                'name' => __( 'Videos' ),
                'singular_name' => __( 'Video' ),
                'add_new' => __( 'Add New' ),
                'add_new_item' => __( 'Add New Video' ),
                'edit' => __( 'Edit' ),
                'edit_item' => __( 'Edit Video' ),
                'new_item' => __( 'New Video' ),
                'view' => __( 'View Video' ),
                'view_item' => __( 'View Video' ),
                'search_items' => __( 'Search Videos' ),
                'not_found' => __( 'No videos found' ),
                'not_found_in_trash' => __( 'No videos found in Trash' ),
                'parent' => __( 'Parent Video' ),
            'public' => true,
            'show_ui' => true,
            'publicly_queryable' => true,
            'show_in_nav_menus' => false,
            'exclude_from_search' => false,
            'hierarchical' => false,
            'rewrite' => array('slug'=>'video'),
            'supports' => array('title', 'editor', 'excerpt', 'thumbnail', 'comments', 'author'),
            'taxonomies' => array('post_tag')

this will enable a whole new video post type, which supports:

array('title', 'editor', 'excerpt', 'thumbnail', 'comments', 'author'),

have a read through the register_post_type()

hope this helps..

share|improve this answer

Your Answer


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