Closed enlego closed 9 years ago
Hook a function in add_meta_boxes
with a higher priority than 10 and remove_metabox
with the id of page-imagen-conocenos
with a context of side
on the page
if its the page you don't want it on (or not the page you want it on)...
Thanks matgargano. I'll paste the solution here in case someone else needs it.
// Add the following code at the end of functions.php
// remove MultiPostThumbnail for pages not using the template page "tp_conocenos.php"
add_action( 'add_meta_boxes', 'remove_img_metabox_conocenos');
function remove_img_metabox_conocenos() {
// get the post id to check which template is usign.
$post_id = $_GET['post'] ? $_GET['post'] : $_POST['post_ID'] ;
$template_file = get_post_meta($post_id,'_wp_page_template',TRUE);
if ($template_file != 'tp_conocenos.php') {
remove_meta_box('page-imagen-conocenos', 'page', 'side');
}
}
I have several pages: About-us, Home, Proyects, etc. When I use the function
the first one
post_type=>'page'
is showing in every page. How can I enable it in Home but disable it in About-us, Proyects, etc?Thanks in advance!