How to add new php file in wordpress theme
For personalized wordpress themes custom .php files are very important. By default you can’t create new php file in wordpress theme from wordpress dashboard. You can use two way to create file on wordpress theme.
- Create new php file on desktop and upload it on wordpress theme folder.
- Or second way is create new php file directly on theme folder from cPanel .
To Creating new php file with first method you can use any html editor or notepad on pc. Open notepad in computer.Create a new blank file in notepad. Now click on file and select save as. Choose file name. select file type to all files and save it.
Example: you want to test.php file on wordpress theme folder. Open blank file in notepad. In the file name field write test.php .select file type to all file and click to save.
In the second method login to cPanel. cPanel is the control panel provided by your web host to you. Go to file manager.
Locate you wordpress installation folder. Under the wordpress installation folder go to wp-content/themes/your-theme-name. And open it by double click.
Now you are in your theme folder. On the upper left side of screen , click on new file tab to create new file. In the file name section write test.php and click to create button.
You can edit test.php file from wordpress dashboard. To locate test.php go to Appearance and then Editor. On right side bar locate test.php and click on it to edit.