// Add custom fields support function wanbuffer_add_custom_fields() { if (function_exists('add_meta_box')) { add_meta_box('page_type_meta', 'Page Type', 'wanbuffer_page_type_callback', 'page', 'side', 'high'); } } add_action('add_meta_boxes', 'wanbuffer_add_custom_fields'); function wanbuffer_page_type_callback($post) { wp_nonce_field(basename(__FILE__), 'wanbuffer_nonce'); $current_type = get_post_meta($post->ID, 'page_type', true); ?>