Skip Navigation

[Resuelto] Remove ‘Content Template’ from sidebar in edit page

Este hilo está resuelto. Aquí tiene una descripción del problema y la solución.

Problem:
Remove 'Content Template' and 'Template Layout' widgets/metabox for certain CPT in admin screen.

Solution:
Please add this code in your theme’s or child theme’s functions.php file:

 
add_action( 'admin_head', 'wpv_custom_admin_head', 20);
function wpv_custom_admin_head() {
    remove_meta_box( 'wpddl_template', 'book', 'side' ); // replace book with your CPT slug
    remove_meta_box( 'views_template', 'book', 'side' ); // replace book with your CPT slug
}

==> Whereas 'book' should be replaced with your CPT slug.

Relevant Documentation:
https://codex.wordpress.org/Function_Reference/remove_meta_box

0% of people find this useful.

This support ticket is created hace 6 años, 7 meses. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Hoy no hay técnicos de soporte disponibles en el foro Juego de herramientas. Siéntase libre de enviar sus tiques y les daremos trámite tan pronto como estemos disponibles en línea. Gracias por su comprensión.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 14:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Jamaica (GMT-05:00)

Etiquetado: 

Este tema contiene 3 respuestas, tiene 3 mensajes.

Última actualización por derekD-2 hace 6 años, 7 meses.

Asistido por: Shane.

Autor
Mensajes
#675794
content-template.jpg

I am trying to: Remove the 'Content Template' metabox from the sidebar in when editing a page.

Link to a page where the issue can be seen:

I expected to see: No, Content Template metabox

Instead, I got: I still see the Content Template metabox on pages, but it has been removed from posts.

I found this page: https://toolset.com/forums/topic/remove-content-template-and-template-layout-widgets-for-editors/ which is supposed to remove the link from pages and posts. It has removed the Content Template box from Posts but not Pages.

This is the code that I used:
// Remove Toolset Content Template meta box
add_action( 'admin_head', 'realtor0_wpv_custom_admin_head', 20);
function realtor0_wpv_custom_admin_head() {
remove_meta_box( 'wpddl_template', 'post', 'side' );
remove_meta_box( 'wpddl_template', 'page', 'side' );
}

You can see that the box is still showing in the image below.

#675814

Shane
Supporter

Idiomas: Inglés (English )

Zona horaria: America/Jamaica (GMT-05:00)

Hello,

Try adding this

    remove_meta_box( 'views_template', 'page', 'side' ); // replace book with your CPT slug

Thanks,
Shane

#676184

Thank you.
That fixed the issue.

#1606029