Categories
About Wordpress

Add a new WordPress theme file without FTP access

If you don’t have FTP access and want to add a new WordPress file to your theme, follow these steps:

1. Go to theme editor (the curent or inactive one) and edit header.php file

2. Add this code on the first line of header.php file (very important to be first line):
<?php touch('wp-content/themes/YOUR_THEME_DIR/FILE_NAME.php'); ?> 
Replace YOUR_THEME_DIR with folder name of your theme, then
replace FILE_NAME with the file name you want to create.

3. Save the change and open the website (first page). If you edit an inactive theme, simply preview of that theme in Live Preview.

4. After you open the website, get back to header.php file edit (as above) and remove that line you added previously (you don’t want troubles, isn’t?).

5. You may alter the new file using theme editor option.

Hope to be usefull. Good luck!

ideea via https://www.webmechanix.com/