解决方法:
'Custom Fields',
'menu_title' => 'Custom Fields',
'menu_slug' => 'custom-fields',
'capability' => 'edit_posts',
'redirect' => false
));
// 在文章编辑页面添加一个自定义字段组
acf_add_local_field_group(array(
'key' => 'group_1',
'title' => 'Custom Field Group',
'fields' => array(
array(
'key' => 'field_1',
'label' => 'Custom Field',
'name' => 'custom_field',
'type' => 'text'
),
),
'location' => array(
array(
array(
'param' => 'post_type',
'operator' => '==',
'value' => 'post',
),
),
),
));
}
// 初始化自定义字段
add_action('init', 'custom_fields');
?>
'Custom Posts',
'singular_name' => 'Custom Post',
);
$args = array(
'labels' => $labels,
'public' => true,
'has_archive' => true,
'supports' => array('title', 'editor', 'thumbnail'),
);
register_post_type('custom_post', $args);
}
// 初始化自定义文章类型
add_action('init', 'custom_post_type');
?>
Bootstrap Carousel Example
相关内容