Skip to content

Instantly share code, notes, and snippets.

@territutich
Last active May 10, 2018 15:33
Show Gist options
  • Save territutich/e360f9534e616960485e7a20d8d5a8a3 to your computer and use it in GitHub Desktop.
Save territutich/e360f9534e616960485e7a20d8d5a8a3 to your computer and use it in GitHub Desktop.
<?php
/**
* If page uses a specific template, load meta boxes
*
*/
add_action('add_meta_boxes', 'add_standardpg_meta');
function add_standardpg_meta() {
global $post;
$pageTemplate = get_post_meta($post->ID, '_wp_page_template', true);
if($pageTemplate != 'page-high-level-child.php' && $pageTemplate != 'page-db-template.php' ) {
add_meta_box(
'contact_metaboxes', // $id
'Contact Information', // $title
'add_contact_metaboxes', // $callback
'page', // $page
'normal', // $context
'high'); // $priority
}
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment