This is strange.
I have a file,
page_market.php, that is named "Market Main Page". It WAS being used when I chose that page template, but now it is not working at all. Instead, it looks like I'm using the default template.
Why is this happening?
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It only takes a minute to sign up.Sign up to join this community
This was driving me nuts, and I finally decided to search for where a page template's value is stored in the database. This gave me my first clue, because I found
single-sponsor.php, the name of one of the other template files I'm building.
I was confused as to why this could be the case, and looked at the HTML of the actual dropdown menu WordPress generated:
<select name="page_template" id="page_template"> <option value="default">Default Template</option> <option value="page-custom.php">Custom Page Example</option> <option value="single-sponsor.php" selected="selected">Market Main Page</option> </select>
Pretty clearly choosing
Why would it be doing that?
Because I told it to.
I had copied the code from
single-sponsor.php to start developing a new page template.
At the top of
<?php /* Template Name: Market Main Page */ ?>
Stupid mistake. But I thought it was worth writing up, in case the same thing happens to someone else.
I changed the name before realizing that I didn't want this file to show up in my template list, so I removed the code.