2

I've just added a new Custom Post Type to my WordPress site.

When I go to create a new post though, the only option I have to edit is "Slug". Normally with a regular post you would have Format, Categories, Post Tags, Featured Image, Excerpy, Send Trackbacks, Custom Fields, Discussion, and Author.

How do I get all of these options to show up for me under a Custom Post Type?

This is the code I used to create my custom post type.

function create_post_type() {  
        register_post_type( 'intrigue_faculty',  
                array(  
                        'labels' => array(  
                        'name' => __( 'Faculty' ),  
                        'singular_name' => __( 'Faculty' ),
                        'add_new_item' => __( 'Add New Faculty Member' ),
                        'new_item' => __( 'Add Faculty' ),
                        'add_new' => __( 'Add Faculty Member' ),
                        'view_item' => __( 'View Faculty Profile' ),
                        'not_found' => __( 'No faculty members found' ),
                        'search_items' => __( 'Search Faculty Members' ),
                        'edit_item' => __( 'Edit Faculty Member Profile' ),
                        'description' => __( 'A collection of the profiles for Intrigue Dance Intensive faculty members.' )
                    ),  
            'public' => true,  
            'menu_position' => 5,  
            'rewrite' => array('slug' => 'faculty')  
            )  
    );  
}  

 add_action( 'init', 'create_post_type' );  

1 Answer 1

4

Did you add post-type support for those features, via add_post_type_support()?

Use this format:

<?php add_post_type_support( $post_type, $supports ) ?>

The $supports argument is an array, that can include the following strings:

  • 'title'
  • 'editor' (content)
  • 'author'
  • 'thumbnail' (featured image) (current theme must also support Post Thumbnails)
  • 'excerpt'
  • 'trackbacks'
  • 'custom-fields'
  • 'comments' (also will see comment count balloon on edit screen)
  • 'revisions' (will store revisions)
  • 'page-attributes' (template and menu order) (hierarchical must be true)
  • 'post-formats' add post formats

Note that support for these features can be registered directly, via the register_post_type() call, using the supports argument-array key. See this abbreviated version of the Codex example:

<?php
add_action('init', 'codex_custom_init');
function codex_custom_init() 
{
  $labels = array();
  $args = array(
    'labels' => $labels,
    'public' => true,
    'publicly_queryable' => true,
    'show_ui' => true, 
    'show_in_menu' => true, 
    'query_var' => true,
    'rewrite' => true,
    'capability_type' => 'post',
    'has_archive' => true, 
    'hierarchical' => false,
    'menu_position' => null,
    'supports' => array('title','editor','author','thumbnail','excerpt','comments')
  ); 
  register_post_type('book',$args);
}
?>

EDIT

Using your own code:

<?php
function create_post_type() {  
    register_post_type( 'intrigue_faculty',  
            array(  
                'labels' => array(  
                    'name' => __( 'Faculty' ),  
                    'singular_name' => __( 'Faculty' ),
                    'add_new_item' => __( 'Add New Faculty Member' ),
                    'new_item' => __( 'Add Faculty' ),
                    'add_new' => __( 'Add Faculty Member' ),
                    'view_item' => __( 'View Faculty Profile' ),
                    'not_found' => __( 'No faculty members found' ),
                    'search_items' => __( 'Search Faculty Members' ),
                    'edit_item' => __( 'Edit Faculty Member Profile' ),
                    'description' => __( 'A collection of the profiles for Intrigue Dance Intensive faculty members.' )
                ),  
            'public' => true,  
            'menu_position' => 5,  
            'rewrite' => array('slug' => 'faculty'), // Don't forget this comma
            // ADD ME HERE; LIST WHATEVER FEATURES FOR WHICH YOU WANT TO ADD SUPPORT
            'supports' => array('title','editor','author','thumbnail','excerpt','comments') 
        )  
    );  
}  
?>

add_action( 'init', 'create_post_type' );

2
  • Thanks for the reply. I've updated my question with the code I used to add my custom post type. I'm having trouble figuring out where in my code I'm suppose to add your code.
    – jkupczak
    Oct 22, 2011 at 16:12
  • See updated answer; I added the 'supports' array argument into your code. Oct 22, 2011 at 16:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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