Function
=======
_x(‘News’, ‘post type general name’),
‘singular_name’ => _x(‘News’, ‘post type singular name’),
‘add_new’ => _x(‘Add New’, ‘news’),
‘add_new_item’ => __(‘Add New News’),
‘edit_item’ => __(‘Edit News’),
‘new_item’ => __(‘New News’),
‘view_item’ => __(‘View News’),
‘search_items’ => __(‘Search News’),
‘not_found’ => __(‘No news found’),
‘not_found_in_trash’ => __(‘No news found in Trash’),
‘parent_item_colon’ => ”
);
$args = array(
‘labels’ => $labels,
‘public’ => true,
‘publicly_queryable’ => true,
‘show_ui’ => true,
‘query_var’ => true,
‘rewrite’ => true,
‘capability_type’ => ‘post’,
‘hierarchical’ => false,
‘menu_position’ => null,
‘supports’ => array(‘title’,’editor’,’thumbnail’)
);
register_post_type(‘news’,$args);
}

?>
Using with template
===================
query_posts(‘post_type=news’);

Advertisements