0
我想顯示我的元框在頁面模板中的值。 謝謝先進!顯示自定義元框在頁面
這是metabox
function traduccion_add_custom_box() {
$screens = array('page');
foreach ($screens as $screen) {
add_meta_box(
'traduccion_sectionid',
__('Inglés', 'traduccion_textdomain'),
'traduccion_inner_custom_box',
$screen
);
}
}
add_action('add_meta_boxes', 'traduccion_add_custom_box');
function traduccion_inner_custom_box($post) {
wp_nonce_field('traduccion_inner_custom_box', 'traduccion_inner_custom_box_nonce');
$ingles = get_post_meta($post->ID, '_my_meta_value_key', true);
wp_editor($ingles, 'traduccion_new_field');
}
IM在我的頁面模板嘗試此的代碼,但不工作
<?php
$custom = get_post_meta($post->ID);
$display_ingles = $custom['ingles'][0];
?>
<?php echo $display_ingles; ?>
thanksss!它像一個魅力 – majito