admin管理员组

文章数量:1391751

I'm developing a custom theme on my local machine (running macOS). I'd like to edit it in my favorite text editor instead of in the browser via the Theme Editor. Is there a way to do this?

Since I'm working locally, I was thinking there might be a way to do this without going over FTP, such as editing the files directly. My dev server is Local/Flywheel.

I'm developing a custom theme on my local machine (running macOS). I'd like to edit it in my favorite text editor instead of in the browser via the Theme Editor. Is there a way to do this?

Since I'm working locally, I was thinking there might be a way to do this without going over FTP, such as editing the files directly. My dev server is Local/Flywheel.

Share Improve this question edited Feb 9, 2020 at 1:18 bertday asked Feb 8, 2020 at 0:03 bertdaybertday 1196 bronze badges 4
  • You should work via FTP, work on files locally and upload them on the server. For example if you have a WINDOWS environment you can use Winscp winscp/eng/index.php, an FTP client that allows to keep local/remote folders syncronized. When you edit a file locally and save it the changes are syncronized with the remote folder – Andrea Somovigo Commented Feb 8, 2020 at 1:30
  • Hi @AndreaSomovigo, thank you for this suggestion! I probably should have been more specific - I'm working locally and would love to edit the files directly rather than going over FTP. I went ahead and updated my question. – bertday Commented Feb 9, 2020 at 1:19
  • 1 If you are already working locally you just need to find the local files and edit them. Just check out the Local by Flywheel docs to find out where the path is on MacOS (eg. on Windows they are under Local Sites subdirectory of your user folder.) – majick Commented Feb 9, 2020 at 1:46
  • 1 I do that when I'm working locally. I use VS Code and have setup the project for the website I'm developing meaning I have the folder structure in tree tab and can navigate the files easily. And while I'm working locally I don't need to use FTP and after I'm done I clone it to the live server. – David Commented Feb 9, 2020 at 21:35
Add a comment  | 

1 Answer 1

Reset to default 0

When you install your theme via the WordPress admin panel, it's just decompressing the ZIP file and placing the contents in a directory. For me, using Local as a dev server, that location was ~/Local Sites/<my-site-name>/app/public/wp-content/themes/<my-theme-name>. You can edit those files directly and the changes will be reflected when you refresh your browser.

本文标签: Can you edit a theme in a text editor