Custom post type “jokes” plus my code snippet

I’ve been working on creating a custom post type for the site. Right now I’ve got one set as Jokes. Just need a few to add into those posts ;).

Check out the code I am using:

/* Actions */
	add_action( 'init', 'wpwag_init' );

/* Filters */

// Fire this during init
function wpwag_init() {
	$supports = array( 'title', 'editor', 'thumbnail', 'trackbacks', 'custom-fields', 'comments', 'page-attributes' );
	register_post_type( 'jokes',
		array(
			'label' 			=> 'Jokes',
			'singular_label' 	=> 'Joke',
			'public' 			=> true,
			'show_ui' 			=> true,
			'_builtin' 			=> false,
			'_edit_link' 		=> 'post.php?post=%d',
			'capability_type' 	=> 'post',
			'hierarchical' 		=> false,
			'rewrite' 			=> array( 'slug' => 'jokes', 'with_front' => false ),
			'query_var' 		=> true,
			//'taxonomies' 		=> array( 'post_tag', 'category' ),
			'supports' 			=> $supports,
			'menu_icon' 		=> get_stylesheet_directory_uri() . '/library/css/images/joker.png',
		)
	);
}

While I don’t find it necessary to share a mass tutorial on how,what and why. You can check out these awesome post tutorials on the custom post types.

  1. WP Codex
  2. Kovshenin
  3. Justin Tadlock
  4. WP Beginner

just to list a few..