Create Custom Post Type

It’s often very helpful to clients to separate different types of posts, so you can present information in the most effective way. Luckily, WordPress makes this a fairly simple venture. Simply add the following to your functions.php file.

// New custom post type along with taxonomy
add_action( 'init', 'create_post_type' );
function create_post_type() {
	register_post_type( 'projects',
		array(
			'labels' => array(
				'name' => 'Projects',
				'singular_name' => 'Projects',
				'edit_item' => 'Edit Project',
				'add_new' => 'Add New Project',
				'new_item' => 'New Project',
				'view_item' => 'View Project',
				'search_items' => 'Search Projects',
				'not_found' => 'No Projects Found',
				'not_found_in_trash' => 'No Projects Found in Trash'
			),
		'public' => true,
		'has_archive' => true,
		'taxonomies' => array('post_tag'), // this is IMPORTANT
		'supports' => array('title', 'editor', 'thumbnail', 'author', 'custom-fields', 'comments')
		)
	);
}