• Not sure whether this is a known bug but when I set the _wp_page_template key to ‘my_template.php’ on a page and I edit the page again, the key gets ‘reset’ to ‘default’. There’s no way to get it right except for going into the database itself and fix the record in wp_postmeta.

    Am I the only one with this problem?

Viewing 5 replies - 1 through 5 (of 5 total)
  • I don’t know if it’s a bug or not (tend to think it is) but that _wp_page_template can NOT be used to define the “template” for a post, which you seemingly are trying to do.

    Thread Starter themarco

    (@themarco)

    I’m defining it for a page, not for a post….
    It displays weird behaviour. Sometimes it works if you do it the very first time you create the page. Edit it again and it’s set to ‘default’ again. I’ve even seen it create two rows in wp_postmeta.

    I’m using a custom template for some static pages. Whenever I edit them I have to rush to phpmysqladmin to fix these entries or the pages will be borked ??

    For defining a template for a Page – create a Page template and then you’ll be able to select it on the Write > Write Page panel in Page Options from the dropdown menu. (Note: the dorpdown is not visible if you don’t have properly created Page templates other than the default one!)

    I did all that as described in the codex and created diferent templates in all the themes. But the drop down menu (in writing page admin menu) doesn’t show up when I use certain themes like shadedgrey. When I try with Dark Maple, I get only 3 – default, archive and search, whereas the defaul theme shows the default, archive and links templates.

    Looks weird, or, am I missing something?

    Please help.

    I think I figured it out. In the template file you have to have this as the first thing in the file.
    <?php
    /*
    Template Name: Snarfer
    */
    ?>

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘_wp_page_template keeps being reset’ is closed to new replies.