Created
May 30, 2018 02:35
-
-
Save dividezigns/0aad790933e4fcc2d2f093f022d2e600 to your computer and use it in GitHub Desktop.
This code will hide the WordPress editor bases on a custom template. Good if you're using your own fields. You can add this code snippet to your functions.php file in your child theme directory.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_action( 'admin_head', 'hide_editor' ); | |
function hide_editor() { | |
$template_file = basename( get_page_template() ); | |
if($template_file == 'template-name.php'){ | |
remove_post_type_support('page', 'editor'); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment