的WordPress 3.3自定义字段模板,自定义文章类型
问题描述:
我使用的WordPress 3.3自定义文章类型模板http://wordpress.org/extend/plugins/custom-field-template/的WordPress 3.3自定义字段模板,自定义文章类型
这使得主编辑器消失,空当您单击负荷加载自定义字段模板 它做工精细与页/职位,但它仅与自定义后类型划分
它用来做什么
答
我截图这是因为该插件不适用于自定义帖子类型。如果你习惯编辑一些代码,它可以很容易地修复。
当您注册自定义后的类型,你应该有一个单独的项目,其中添加一些代码的插件时,你需要知道选择一个名字。例如,默认的WordPress的帖子的名称是“帖子”,页面使用的是“页面”。
一旦你知道这个名字,在插件文件夹打开“自定义场的template.php”,并滚动到行155,你应该看到这一点:
add_meta_box('cftdiv', __('Custom Field Template', 'custom-field-template'), array(&$this, 'insert_custom_field'), 'post', 'normal', 'core');
add_meta_box('cftdiv', __('Custom Field Template', 'custom-field-template'), array(&$this, 'insert_custom_field'), 'page', 'normal', 'core');
如果你看一下到底,你会看到该插件专门增加了“后” &“页”支持,你需要复制这些线路之一,只有替补“后/页”与自定义文章类型的名称,例如:
add_meta_box('cftdiv', __('Custom Field Template', 'custom-field-template'), array(&$this, 'insert_custom_field'), '%YOUR-CPT-NAME%', 'normal', 'core');
我假设你也应该禁用CPT的其他自定义字段,j就像插件一样,可以用相同的程序完成。添加
remove_meta_box('postcustom', '%YOUR-CPT-NAME%', 'normal');
下面的其他人开始约158/159。
我想这应该解决您的问题,但你的问题不是很清楚。请跟进你的结果。
+0
没有马特它不会做任何事情 – 2012-02-10 10:43:47
而问题是什么? – elclanrs 2012-02-09 05:19:32
它使主编辑器消失,空当您单击自定义后类型的负载。这是问题 – 2012-02-09 09:02:01