首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Wordpress自定义分类值不显示在菜单中

Wordpress自定义分类值不显示在菜单中
EN

Stack Overflow用户
提问于 2014-04-03 10:42:26
回答 1查看 771关注 0票数 0

我已经创建了一个新的自定义分类法,我为该分类法输入的值在此处的编辑帖子区域中可见/保存:

然而,当我点击管理菜单中的'Custom Post‘按钮时,它们似乎没有保存/显示,你可以在那里进行快速编辑:

下面是我的functions.php文件中的代码:

代码语言:javascript
复制
function create_seamstitch_taxonomy() {
$labels = array(
    'name'                       => 'Seam Stitching',
    'singular_name'              => 'Seam Stitching',
    'menu_name'                  => 'Seam Stitching',
    'all_items'                  => 'All Seam Stitching',
    'parent_item'                => 'Parent Seam Stitching',
    'parent_item_colon'          => 'Parent Seam Stitching:',
    'new_item_name'              => 'New Seam Stitching Name',
    'add_new_item'               => 'Add New Seam Stitching',
    'edit_item'                  => 'Edit Seam Stitching',
    'update_item'                => 'Update Seam Stitching',
    'separate_items_with_commas' => 'Separate Seam Stitchings with commas',
    'search_items'               => 'Search Seam Stitching',
    'add_or_remove_items'        => 'Add or remove Seam Stitchings',
    'choose_from_most_used'      => 'Choose from the most used Seam Stitchings',
    'not_found'                  => 'Seam Stitching Not Found',
);
$args = array(
    'labels'                     => $labels,
    'hierarchical'               => false,
    'public'                     => true,
    'show_ui'                    => true,
    'show_admin_column'          => true,
    'show_in_nav_menus'          => true,
    'show_tagcloud'              => true,
);
register_taxonomy( 'seamstitching', 'buttonup', $args );
}

// Hook into the 'init' action
add_action( 'init', 'create_seamstitch_taxonomy', 0 );

有人知道为什么会发生这种情况吗?在我的帖子中,这似乎也不起作用:

代码语言:javascript
复制
<?php echo get_the_term_list( $post->ID, 'seam_stitching', 'Seam Stitching: ', ', ', ''         ); ?> 

谢谢你的帮助!

EN

回答 1

Stack Overflow用户

发布于 2014-04-03 11:18:03

好了,我更改了分类法的名称,并重新输入了数据,现在一切正常。此问题可能源于首先在名称中使用大写首字母注册分类,然后切换为较低。我完全改变了它,现在它似乎起作用了。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/22826858

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档