Skip to content

Instantly share code, notes, and snippets.

@azizultex
azizultex / Add Option Tree Metabox to Specific Page Template Only
Last active September 25, 2016 15:22
Add Option Tree Metabox to Specific Page Template Only
$post_id = $_GET['post'] ? $_GET['post'] : $_POST['post_ID'];
$template_file = get_post_meta($post_id, '_wp_page_template', TRUE);
if ($template_file == 'welcome.php') {
ot_register_meta_box( $home_page_meta_box );
}
/* -------------------------------------------------------------