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

image - ClassNotFoundException when add a prebuilt apk into system.img in android -

I need to import mysql 5.1 to 5.5? -

Java, Hibernate, MySQL - store UTC date-time -