- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我有一个自定义元框(分类法),它位于我的自定义帖子的一侧。我想将它移动到正常位置,但是当我删除它(remove_meta_box)并重新添加(add_meta_box)时,我只得到 bar,没有选择任何东西的选项。我想我没有写正确的 $callback,但我尝试了很多变体,但没有任何线索。
function create_isotope_taxonomies()
{
$labels = array(
'name' => _x( 'Select Category', 'taxonomy general name' ),
'singular_name' => _x( 'Category', 'taxonomy singular name' ),
'search_items' => __( 'Search Categories' ),
'popular_items' => __( 'Popular Categories' ),
'all_items' => null,
'parent_item' => null,
'parent_item_colon' => null,
'edit_item' => __( 'Edit' ),
'update_item' => __( 'Update' ),
'add_new_item' => __( 'Add New' ),
'new_item_name' => __( 'New Category' ),
'separate_items_with_commas' => __( 'Separate writers with commas' ),
'add_or_remove_items' => __( 'Add or remove categories' ),
'choose_from_most_used' => __( 'Choose from the most used categories' ),
'menu_name' => __( 'Categories' ),
);
register_taxonomy('fzisotope_categories','fzisotope_post',array(
'hierarchical' => true,
'labels' => $labels,
'show_ui' => true,
'show_admin_column' => true,
'update_count_callback' => '_update_post_term_count',
'query_var' => true,
'rewrite' => array( 'slug' => 'fzisotope_categories' ),
));
}
function fzisotope_categories_meta_box(){
remove_meta_box('fzisotope_categoriesdiv', 'fzisotope_post', 'side');
add_meta_box( 'fzisotope_categoriesdiv', 'Select Category', 'fzisotope_categories_meta_box', 'fzisotope_post', 'normal', 'high');
//print '<pre>';print_r( $wp_meta_boxes['post'] );print '<pre>';
}
add_action( 'admin_init', 'fzisotope_categories_meta_box', 0 );
最佳答案
你必须使用:
post_categories_meta_box 用于具有层次结构的分类法。
remove_meta_box('fzisotope_categoriesdiv', 'fzisotope_post', 'side');
add_meta_box( 'fzisotope_categoriesdiv', 'XXXXXXXXXXX', 'post_categories_meta_box', 'post', 'normal', 'high', array( 'taxonomy' => 'fzisotope_categories' ));
关于Wordpress 自定义分类法移动 meta_box,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14512203/
我需要创建嵌套分类法。 (用于深入搜索) 示例:我有一个词汇表: 汽车 -梅赛德斯 --SLK --时钟 -宝马 --7系列 --3系列 -阿斯顿·马丁 --DB9 --DB7 我想要做的是有 3 个
我正在创建一个 Wordpress 博客(还没有实时链接,因为它仍处于规划阶段)。我想设置以下标签结构: 第 1 类:服务标签:网页设计、标志设计、打印设计等。 第 2 类:客户类型标签:小企业, 大
我正在尝试翻译 Hugo 中的标签。 我的标签仅在我的帖子的元数据中声明: --- author: arthur.sw date: 2007-01-01T00:00:35Z tags: - exp
我的产品目录是一个经典的树状层次结构,具有不同级别的子分组。在子分组的每个级别,产品将共享 type:value 的属性。在树的最底层,将有继承了上层所有属性的产品,加上自己独特的属性。 我设想使用两
我正在做一个项目,想创建一个与 Wordpress 具有的分类功能类似的功能。 虽然我不太确定这一切是如何运作的。 他们有 3 个相关的表: wp_terms ( term_id, nam
我正在寻找嵌入式处理器的分类法。哪些处理器属于哪些家族?谁从谁下来? 这里有人知道描述它的简单文章吗? 最佳答案 Common Microcontrollers维基百科页面可能是一个起点,或者this
我有以下 PowerShell,它返回存储在 SharePoint 托管元数据中的所有部门的列表: Add-PSSnapin Microsoft.Sharepoint.Powershell # Get
我希望角色 Editor 能够访问所有 woocommerce 管理,我通过向该角色添加功能来设法做到这一点: $role = get_role( 'editor' ); $role-
我是 plone 和内容管理工具的新手。 我们在我们实验室的出版物列表所在的位置安装了一个plone。 我只是想要一些类似 EEA 导航的演示,我可以在其中定义例如作者小部件 field 小部件 以及
我正在建立一个汽车服务数据库。每个汽车服务都可以维修多种型号的汽车。 存储汽车服务和类型之间的关系以便以后能够查询的最佳方式是什么? 我的选择是: 对于每辆车,将模型保存为 post_meta 作为单
如何在批量导入/删除后更新 WordPress 分类法(类别/标签)的计数字段? 相关问题: WordPress › 支持 » 导入后修复评论和类别计数 http://wordpress.org/su
我正在尝试使用 WordPress REST API 获取分类列表。点击 /wp-json/wp/v2/taxonomies/post_tag 工作正常,但我还有一个名为 location 的自定义分
我正在使用 C# 更新管理元数据字段。 以下是获取 term 的 TermId 的代码。 string termId = string.Empty; try
我是一名优秀的程序员,十分优秀!