0

I just feel the need to mention I'm not a rookie. I code my own "lean and mean" templates, and know my way around PHP. That said, today I had a problem. I have a page... "foo", to which I applied a custom template. The page would not use it! In fact it decided to use front-page.php. Of course this page, "foo", was not the statically assigned home page.

On a whim, I tried page-[id].php - nope, even page.php (which I did not have or need) was not picked up.

Even the generated code was strange! The body tags indicated "page-template-template_foo" but still it was loading "front-page.php".

Naturally (after flushing permalinks - de rigueur) I swapped out the template for default at this point, to troubleshoot. It was fine. Great! A functions.php problem right? But when I swapped back to my template all was fine!

My question: What mechanism could possibly have alleviated this problem via a template deactivation and reactivation?

  • What makes you think it was using front-page.php specifically? Also, templates aren't "activated", so when you say you reactivated it, what do you mean? – Jacob Peattie Feb 18 at 5:27
  • Hi. It was certainly using front-page since I hardcoded "Hi - I'm the front-page" into it. By "reactivation", I mean I switched out the template for 2020 and then switched back. The button for that in fairness is literally labelled "activate" ;) – mayersdesign Feb 18 at 8:21
  • Close voted because not about Wordpress? What on earth? What's it about then cabbages? – mayersdesign Feb 18 at 8:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.