i want to make this code for pages
add_action( \'add_meta_boxes\', \'meta_box_video\' );
function meta_box_video()
{
add_meta_box( \'video-meta-box-id\',
This:
function meta_box_video()
{
add_meta_box( 'video-meta-box-id', 'Video Embed', 'meta_box_callback', 'post', 'normal', 'high' );
}
Should specify page
not post
.
function meta_box_video()
{ // --- Parameters: ---
add_meta_box( 'video-meta-box-id', // ID attribute of metabox
'Video Embed', // Title of metabox visible to user
'meta_box_callback', // Function that prints box in wp-admin
'page', // Show box for posts, pages, custom, etc.
'normal', // Where on the page to show the box
'high' ); // Priority of box in display order
}
Take a look at the Codex for add_meta_box(). The examples are very helpful. The portion you are interested in is under "Parameter". The fourth parameter allows you to specify whether you want the metabox on pages, posts, etc.