# Custom Post Types # ![picture of Ryan Tvenge](img/me.jpg) ###[@rtvenge](https://twitter.com/rtvenge) | [ryantvenge.com](http://ryantvenge.com/) ### ### Co-Founder of [Hoverboard](http://hoverboardstudios.com) ###
#What is a Post Type?#
##Wordpress Post Types## Wordpress uses all sorts of post types in it's data architecture: * posts * pages * much more
##The Problem## * What if I wanted to add products to my site? * You could create a "products category" in your posts, but then your products would show up on your blog posts page.
##There's an easier way…##
#Custom Post Types#
###What is a Custom Post Type?### ![picture of a menu in Wordpress admin using Custom Post Type 'Articles'](img/cpt-menu.png) * Debuted in Wordpress 3.0 * Extends the functionality of "posts" * Use cases: * Products * Events * News * Home Page Slides
##Plugins that use CPT's## * [Events Calendar](http://wordpress.org/extend/plugins/the-events-calendar/) * [Wordpress Catalog](http://wordpress.org/extend/plugins/catalog/) * Much more
#How do I use these puppies?#
##How to Implement## Add this code to your functions.php file
add_action( 'init', 'create_post_type' );
function create_post_type() {
	register_post_type( 'acme_product',
		array(
			'labels' => array(
				'name' => __( 'Products' ),
				'singular_name' => __( 'Product' )
			),
		'public' => true,
		'has_archive' => true,
		)
	);
}
						
##Code implementation great for…## * Writing a plugin/theme from scratch * A developer handing a site off to a client
##What if…## * You don't want to write any code * You don't have access to the theme's functions.php?
#There's a plugin for that!# [http://tinyurl.com/wordpress-cpt](http://tinyurl.com/wordpress-cpt/)
#Demo Time!# local wordpress
##"News" Demo## * Reduced test case * You can get much more complex * See [plugin examples](#/2/2)
#Thank You!# * Twitter: [@rtvenge](https://twitter.com/rtvenge) | [@hoverboard88](https://twitter.com/hoverboard88) * website: [ryantvenge.com](http://ryantvenge.com/) | [Hoverboard Studios](http://hoverboardstudios.com) * GitHub: [rtvenge](http://github.com/rtvenge/) | [hoverboard88](http://github.com/hoverboard88/)