ID, '_wp_page_template', true ); if ( $pageTemplate == 'template-home.php' && class_exists( 'WooCommerce' ) ) { add_meta_box( 'bestore_options-bestore-options', __( 'Page Options', 'bestore' ), 'bestore_options_html', 'page', 'normal', 'high' ); } } add_action( 'add_meta_boxes', 'bestore_options_add_meta_box' ); function bestore_options_html( $post ) { wp_nonce_field( '_bestore_options_nonce', 'bestore_options_nonce' ); $post_id = get_the_ID(); if ( get_post_type( $post_id ) != 'page' ) { return; } $value = get_post_meta( $post_id, 'bestore_cat', true ); ?>