如何在自定义帖子类型中显示类别

时间:2016-06-07 19:45:22

标签: php wordpress custom-wordpress-pages

<?php 

   register_post_type(
   'comet_portfulio', array( 
    'labels'    =>  array(
            'name'  =>  'Portfulios',
            'add_new'   =>  'Add New Portfulio',
            'Add_new_item'  =>  'Add New Portfulio' ,
        ),
    'public'    => true, 
    'supports'  =>  array('title','thumbnail','editor'),
    'rewrite'   =>  array(
        'slug'  =>  'portfulio' 
    ),
    'menu_icon' =>  'dashicons-portfolio',
 ));

 // Register Portfulio Taxonimy

 register_taxonomy(
  'portfulio_cat','comet_portfulio', array( 
    'labels'    =>  array(
            'name'  =>  'Catagory',
            'add_new'   =>  'Add New catagory',
            'Add_new_item'  =>  'Add New Catagoer' ,
        ),
    'public'        => true,  
    'hierarchical'  =>  true,
 ));

&GT;

0 个答案:

没有答案