Before pasting this code in your function.php file, edit line 11 and replace contact.php by the name of the page you want to disable the editor for.
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; // Get the name of the Page Template file. $template_file = get_post_meta($post_id, '_wp_page_template', true); if($template_file == 'contact.php'){ // edit the template name remove_post_type_support('page', 'editor'); } }
Credit: Snipplr.
The post How to disable content editor for a specific page template appeared first on WPRecipes.
What’s My SEO Score?
Enter the URL of any landing page or blog article and see how optimized it is for one keyword or phrase.
Latest posts by WordPress Expert (see all)
- GetResponse Review: Is It Worth It? (Features, Pricing, and Alternatives) - January 28, 2022
- 9 Top Zoho Alternatives that are Worth Their Money - January 27, 2022
- How to Fix “This account has been suspended” Message - January 25, 2022
You must log in to post a comment.