Why can I only edit a custom theme file via Theme Editor, but modifying via FTP does not work?


I’m in the process of taking over a WordPress site (v5.4.4) for a client from another developer, and I’m encountering a very strange problem.

There is a custom PHP file that’s part of their modified theme—let’s call it custom-header.php. If I edit that file and upload it via FTP or the cPanel File Manager, the changes I make are not reflected on the site—even when I reload the page using "Empty Cache and Hard Reload" in Chrome. The only way to change this file seems to be by editing it through the Appearance > Theme Editor tool in the WordPress backend for the site.

I’ve searched the entire server directory structure, and there is no other custom-header.php file, so I know I’m editing the right file. When I upload a changed version of the file, I can see that the timestamp correctly updates on the server. If I redownload it, I can see my changes in the downloaded file. But none of the changes actually show up on the site. The only way to change this file is by editing it with the Theme Editor. (Similarly, changes made with Theme Editor aren’t reflected on the server file timestamp.)

What is going on here? There is some sort of disconnect between the Theme Editor and the files on the server, but I can’t figure out why.

Michael 2 months 0 Answers 13 views 0

Leave an answer