0

I'm not sure how to explain what the problem is so I will go with a story:

I had a working local WordPress installation with a custom child theme. In the child theme, I had files like style.css, footer.php or index.pl - which I used to place my HTML and CSS.

To run it on a server I used the command php -S 127.0.0.1:8000 in my Mac terminal. Everything was working up to this point.

After committing my work, I saw that the folder of my child theme was misspelled "tweentyfifteen-child", so I renamed it "twentyfifteen-child" while the server was running. This made the site not render correctly.

Problem:

  • I tried to revert all changes so I renamed folder back to "tweentyfifteen-child", but this didn't help. Main page still was not rendering any of my html.
  • when I go to Theme editor I see that files like footer.php are not there, only css,
  • I even deleted old database and created new one with the same name. Then downloaded clean copy of WordPress. And after setting database credentials in wp-config.php and running installation process, I can see Twenty Fifteen Child theme in WordPress CMS, even when there is no folder like that in wp_content/themes.

This left me with thinking that when I run php -S 127.0.0.1:8000 there must be some caching going on...

Help.

1 Answer 1

1

After more than a half of a day of battle, I found out that style.css has to be in direct subdirectory of a child theme. I had placed it under the /css/ folder together with other styles. That's why WordPress couldn't find PHP files... Weird thing is that this folder structure has worked when I was still developing site.

1
  • you do not have to actually use it but a style.css just has to be in the root directory of your theme. Not sure how did you get anything to work at all unless you had the file in the proper place when you switched themes and moved it later Commented Feb 4, 2017 at 17:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.