Google搜索seo推广公司坦桑尼亚怎么实现 - 专业的渠道

之前介绍过自定义分类法函数register_taxonomy的一些参数,今天咱们来创建你的第一个自定义分类法页面,我这里就以xx-blog主题创建的小册为例说明function create_xiaoce_menu(){$labels =

wordpress创建你的第一个分类法页面

之前介绍过自定义分类法函数register_taxonomy

的一些参数,今天咱们来创建你的第一个自定义分类法

页面,我这里就以xx-blog主题

创建的小册为例说明

function create_xiaoce_menu()

{

$labels = array(

'name' => '小册创建',

'singular_name' => 'country',

'search_items' => '搜索',

'popular_items' => '热门',

'all_items' => '所有',

'parent_item' => null,

'parent_item_colon' => null,

'edit_item' => '编辑',

'update_item' => '更新',

'add_new_item' => '添加',

'new_item_name' => '小组名称',

'
separate_items_with_commas' => '按逗号分开',

'add_or_remove_items' => '添加或删除',

'choose_from_most_used' => '从经常使用的类型中选择',

'menu_name' => '小册创建',

);

$args = array(

'labels' => $labels,

'hierarchical' => true,

'description' => '小册创建',

'public' => true,

'menu_position' => 5,

'exclude_from_search' =>false,

'supports' => array( 'title', 'editor', 'category', 'thumbnail', 'excerpt', 'comments' ),

'has_archive' => true,

'query_var' => true,

);

register_taxonomy( 'docs', 'doc', $args );

}

add_action('init','create_xiaoce_menu'); //必须把操作函数挂载到 init 钩子上

将上面的代码放到 function.php 中就可以在wordpress后台看到小册的分类了,并且可以添加对应的小册分类信息。

wordpress创建你的第一个分类法页面