Hide Default Editor in Admin
If you want to remove the default editing area from specific pages or posts in the admin area here is how to do it. Put the following in your functions.php file:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | // ---- Hide default editor add_action( 'admin_init', 'hide_editor' ); function hide_editor() { // Get the Post ID. $post_id = $_GET['post'] ? $_GET['post'] : $_POST['post_ID'] ; if( !isset( $post_id ) ) return; // Hide the editor on a specific page based on title. Replace PAGENAME with your page $homepgname = get_the_title($post_id); if($homepgname == 'PAGENAME'){ remove_post_type_support('page', 'editor'); } // Hide the editor on a page with a specific page template. Replace template-filename-here.php with your page template filename // Get the name of the Page Template file. $template_file = get_post_meta($post_id, '_wp_page_template', true); if($template_file == 'template-filename-here.php'){ // the filename of the page template remove_post_type_support('page', 'editor'); } } |