How to add a file to wordpress theme from apparence->editor?

How to create a new file in my wordpress theme without using ftp client ?

thanks !

Read More

fils models list

Related posts

2 comments

  1. Using touch(); PHP function, which creates a new file in the specified directory. This is how I suggest doing it (and admittedly, there are cleaner ways, but this will get the job done, quickly and effectively)…

    Open header.php — then write this code in the very top of the file:

    <?php touch('wp-content/themes/YOUR_THEME_DIR/FILE_NAME.php');?>
    

    Replace YOUR_THEME_DIR with the directory in which your WordPress theme lives.

    Then, replace FILE_NAME with the name of the file you want to create.

    Once that’s all done, save Header.php and go to the homepage of your site.
    As soon as the homepage loads, it will create that new template or theme file.

    Source :
    https://www.webmechanix.com/how-to-create-a-new-theme-file-in-wordpress-without-ftp-access/

Comments are closed.