array(
'id' => 'colornews_page_layout',
'value' => 'default_layout',
'label' => __('Default Layout', 'colornews')
),
'right-sidebar' => array(
'id' => 'colornews_page_layout',
'value' => 'right_sidebar',
'label' => __('Right Sidebar', 'colornews')
),
'left-sidebar' => array(
'id' => 'colornews_page_layout',
'value' => 'left_sidebar',
'label' => __('Left Sidebar', 'colornews')
),
'no-sidebar-full-width' => array(
'id' => 'colornews_page_layout',
'value' => 'no_sidebar_full_width',
'label' => __('No Sidebar Full Width', 'colornews')
),
'no-sidebar-content-centered' => array(
'id' => 'colornews_page_layout',
'value' => 'no_sidebar_content_centered',
'label' => __('No Sidebar Content Centered', 'colornews')
)
);
/* * ************************************************************************************* */
/**
* Displays metabox to for select layout option
*/
function colornews_page_layout() {
global $page_layout, $post;
// Use nonce for verification
wp_nonce_field(basename(__FILE__), 'custom_meta_box_nonce');
foreach ($page_layout as $field) {
$layout_meta = get_post_meta($post->ID, $field['id'], true);
if (empty($layout_meta)) {
$layout_meta = 'default_layout';
}
?>
/>