Custom meta box for post and pages

A custom meta (or write) box is incredibly simple in theory. It allows you to add a custom piece of data to a post or page in WordPress.

meta box main used  plugin developers to add meta boxes to the administrative interface.

Put This Code in functions.php

 add_action( 'add_meta_boxes', 'meta_box_keywords' );
function meta_box_keywords()
{
$post_page = array( 'post', 'page' );
foreach ( $post_page as $post_pages ) {
add_meta_box( 'meta_box_keyword_id', 'Product Option', 'akey_word', $post_pages, 'normal', 'high' );
}
} 
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s