Skip to content

Instantly share code, notes, and snippets.

@victoras
Created January 21, 2014 20:41
Show Gist options
  • Select an option

  • Save victoras/8547950 to your computer and use it in GitHub Desktop.

Select an option

Save victoras/8547950 to your computer and use it in GitHub Desktop.
Custom meta box for pages
<?php
/*-----------------------------------------------------------------------------------*/
/* Initialize the meta boxes.
/*-----------------------------------------------------------------------------------*/
add_action( 'admin_init', 'wpl_meta_boxes' );
function wpl_meta_boxes() {
/*-----------------------------------------------------------
Custom meta box for pages
-----------------------------------------------------------*/
$page_meta_box = array(
'id' => 'page_meta_box',
'title' => 'Page Options',
'desc' => '',
'pages' => array( 'page' ),
'context' => 'normal',
'priority' => 'high',
'fields' => array(
array(
'label' => 'Header image',
'id' => 'wpl_parallax_image',
'type' => 'upload',
'desc' => 'The image will display upper the content, the required dimensions: (1920x714px)',
'std' => '',
'rows' => '',
'post_type' => '',
'taxonomy' => '',
'class' => '',
'section' => ''
)
)
);
ot_register_meta_box( $page_meta_box );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment