Last active
January 30, 2018 17:41
-
-
Save jimfloss/d3f933d1aaa8fa941bbc47a74edc8507 to your computer and use it in GitHub Desktop.
Add custom meta boxes to specific post or page
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function add_custom_meta_boxes_to_page() { | |
global $post; | |
if ( 'product-configurator' == $post->post_name ) { | |
remove_post_type_support('page', 'editor'); | |
add_meta_box( 'description_of_configurator', __('Configurator Information'), 'description_of_configurator', 'page', 'normal', 'high' ); | |
add_meta_box( 'hero_content', __('Hero Content'), 'hero_content', 'page', 'side', 'low' ); | |
} | |
} | |
add_action( 'add_meta_boxes_page', 'add_custom_meta_boxes_to_page' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment