php - How to create custom post types with categories in wordpress with its category? -


how create custom post types in wordpress category

i want create news section in site (same posts), want create own news section having post type news. please make suggestion.

try :

<?php add_action( 'init', 'create_post_type' ); function create_post_type() {     register_post_type( 'news',     array(       'labels' => array(         'name' => __( 'news' ),         'singular_name' => __( 'news' )       ),       'capability_type' =>  'post',       'public' => true,       'supports' => array(       'title',       'editor',       'excerpt',       'trackbacks',       'custom-fields',       'revisions',       'thumbnail',       'author',       'page-attributes',       )     )   ); } register_taxonomy( 'news_category', 'news',array('label' => __( 'categories' ),'rewrite' => array( 'slug' => 'news_category' ),'hierarchical' => true, ) ); ?> 

Comments

Popular posts from this blog

plot - Remove Objects from Legend When You Have Also Used Fit, Matlab -

java - Why does my date parsing return a weird date? -

Need help in packaging app using TideSDK on Windows -