Support

Account

Home Forums General Issues Custom Post Types Reply To: Custom Post Types

  • I would recommend not using a plugin to create custom post types.

    You can register custom post types by adding a function to your themes functions.php file.

    Here’s an example:

    // REGISTER CUSTOM POST TYPES
    // You can register more, just duplicate the register_post_type code inside of the function and change the values. You are set!
    if ( ! function_exists( 'create_post_type' ) ) :
    
    function create_post_type() {
    	
    	// You'll want to replace the values below with your own.
    	register_post_type( 'genstarter', // change the name
    		array(
    			'labels' => array(
    				'name' => __( 'Gen Starter' ), // change the name
    				'singular_name' => __( 'genstarter' ), // change the name
    			),
    			'public' => true,
    			'supports' => array ( 'title', 'editor', 'custom-fields', 'page-attributes', 'thumbnail' ), // do you need all of these options?
    			'taxonomies' => array( 'category', 'post_tag' ), // do you need categories and tags?
    			'hierarchical' => true,
    			'menu_icon' => get_bloginfo( 'template_directory' ) . "/images/icon.png",
    			'rewrite' => array ( 'slug' => __( 'genstarters' ) ) // change the name
    		)
    	);
    
    }
    add_action( 'init', 'create_post_type' );
    
    endif; // ####