1

Is there a way to hide certain template files from Appearance > Editor? Only want files that should be editable to display in the listing in the right hand column. This is in order to reduce clutter, not a permissions type of issue. Thanks!

0

Yes, there is a way to hide template files from Wordpress' Appearance Editor. All you need to do is move the files so that it is two folders deep from your theme folder.

theme-folder/two/folders/template.php

Doing this should keep it from showing up in the editor.

Hope this helps.

0

Often when developing a WordPress theme, you will add template files to allow certain functionality on the site. If these files are listed in the themes main folder, wp-content/themes/theme-name/template-file.php for example, they will show in the WordPress File Editor in the WordPress Admin Panel under Appearance > Editor. Also, if these files are listed inside a folder at the theme directory file level, wp-content/themes/theme-name/templates/template-file.php for example, they will show in the Editor as well.

In order to hide certain php files from the WordPress Appearance File Editor, you will need to put those files at least 2 folders deep from the theme directory file level. An example of this would be: wp-content/themes/theme-name/templates/hidden/template-file.php.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.