【发布时间】:2012-08-28 14:22:15
【问题描述】:
我已经为我正在开发的 wordpress 网站设置了 3 种自定义帖子类型,使用 functions.php 中的以下代码:
if ( function_exists('add_action') )
{
add_action( 'init', 'create_post_types' );
function create_post_types()
{
register_post_type('dj',Array('labels' => Array('name' => "DJ’s",'singular_name' => "DJ"),'public' => true,'has_archive' => true));
register_post_type('gerecht',Array('labels' => Array('name' => "Gerechten",'singular_name' => "Gerecht"),'public' => true,'has_archive' => true));
register_post_type('agenda',Array('labels' => Array('name' => "Agenda",'singular_name' => "Evenement"),'public' => true,'has_archive' => true));
}
}
但在 wp-admin 屏幕中,我无法在帖子中添加任何元信息。我该如何解决这个问题,还是不可能?
编辑:我不想为此使用任何插件,而是自己编写代码。
【问题讨论】:
标签: php wordpress custom-post-type