background preloader

Developer

Facebook Twitter

Modernizr. BatchDownload. 8 useful code snippets to get started with WordPress 3.0. How to create a custom post type Custom post type are an incredible step forward for WordPress, because it will allow developers to create post types according to their needs. For now, we have posts, and pages. With WordPress 3.0, we’ll be able to create a new post type called products, where a client can sell his products only, while regular post for his blog.

Creating a custom post type is easy: All you have to do is to open your theme functions.php file and paste the following: $args = array( 'label' => __('Products'), 'singular_label' => __('Product'), 'public' => true, 'show_ui' => true, 'capability_type' => 'page', 'hierarchical' => false, 'rewrite' => true, 'query_var' => 'products', 'supports' => array('title', 'thumbnail') ); register_post_type( 'product' , $args ); Custom post types with custom taxonomies In the previous example, I’ve shown you how to create a custom post type, which is pretty useful to use WordPress as a real CMS and not a simple blog publishing platform.

<ul><? Extensions Firefox pour développeurs Web sur Journal du Net. Get Bookmark Add-ons.