Home / posts / Custom post types
  • How to Custom post types

    no thumbnail sorry: Custom post types

    Adding this to your functions.php will enable product as a new post type like posts & pages. This is a great new feature in wordpress 3.0.

    ( click code to copy )

    wordpress snippet : PHP

    <>
    $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 );
    

    ( WordPress codex functions, hooks, in this snippet. )

    register, query, register_post_type, __,