我在这个答案的帮助下创建了一个自定义元框,但是这个元框只出现在编辑后的屏幕上。如何使它在“页面”上可见,以及通过当前主题创建的自定义post类型。
更新:代码来自添加自定义元框的function.php:
/* Define the custom box */
add_action( 'add_meta_boxes', 'wpse_61041_add_custom_box' );
/* Do something with the data entered */
add_action( 'save_post', 'wpse_61041_save_postdata' );
/* Adds a box to the main column on the Post and Page edit screens */
function wpse_61041_add_custom_box() {
add_meta_box(
'wpse_61041_sectionid',
'Does this page is in Englsih?',
'wpse_61041_inner_custom_box',
'post',
'side',
'high'
);
}我不明白如何添加page和custom-post-types来使meta-box在那里可见。
发布于 2013-10-09 08:25:34
我总是使用Meta,它非常容易:
多个post元示例:
https://wordpress.stackexchange.com/questions/117214
复制相似问题