`add_filter('rwmb_meta_boxes', 'main_page_register_meta_boxes');
Код: Выделить всё
function main_page_register_meta_boxes( $meta_boxes ) {
$prefix = '';
remove_post_type_support('page', 'editor');
$meta_boxes[] = [
'title' => esc_html__( 'Header', 'Header' ),
'id' => 'Header_section_1',
'post_types' => ['page'],
'context' => 'normal',
'include' => array(
'template' => array( 'content-mainPage.php' ),
),
'fields' => [
[
'type' => 'text',
'name' => esc_html__( 'title', 'title' ),
'id' => $prefix . 'title',
],
[
'type' => 'wysiwyg',
'name' => esc_html__( 'Description', 'Description' ),
'id' => $prefix . 'Description',
],
],
];
return $meta_boxes;
}`
Код: Выделить всё
'include' => array( 'template' => array( 'content-mainPage.php' ), ),Кто-нибудь знает, как создать метабокс, который будет назначен определенный шаблон страницы Wordpress?
Источник: https://stackoverflow.com/questions/781 ... plate-page
Мобильная версия