WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Theme editor does not show all template files (6 posts)

  1. saphod
    Member
    Posted 7 years ago #

    Somehow, after upgrading to WP 2.1, the online theme editor that one can use via WP-interface does not show all but only some of the templates that are stored in the wp-content/themes directory, although I have set all attributes equal for all files... how come?

  2. glaughton
    Member
    Posted 7 years ago #

    Yes, it's strange. I created a new template (by copying page.php to e.g. newtemp.php and then editing it to include the template name at the top) and then created a page with that template. But the theme editor does not list the new template.
    I have looked at the Theme Editor source code (ie the generated HTML) and my new template file is in the list as the link (ie newtemp.php) but with no text, which is why it doesn't appear.
    Anybody know why ? My page works fine and of course I can edit my new template outside WP, but it would be nice if it's accessible through the theme editor.
    (This whole behaviour is intermittent - I created a new template the other day and everything worked fine, but I can't see what I did differently!)

  3. koenoezsi
    Member
    Posted 7 years ago #

    You must change the information in the top of the template:

    old:

    
    <?php
    /*
    Template Name: information
    */
    ?>
    

    new:

    
    <?php
    /* Template Name: information */
    ?>
    

    I don't know why, but it works.

  4. glaughton
    Member
    Posted 7 years ago #

    Great tip, koenoezsi!
    Many thanks, it works fine now. So easy when you know how!

  5. Mark Jaquith
    WordPress Lead Dev
    Posted 7 years ago #

    This issue will be fixed in WP 2.1.1 (first bugfix release for the 2.1 branch... release date TBD).

    http://trac.wordpress.org/ticket/3674

    The bug is that you need a space after the last character of your template name, which is why koenoezsi's suggestion works.

  6. saphod
    Member
    Posted 7 years ago #

    Thank you very much for your help!
    I now declare this post resolved.

Topic Closed

This topic has been closed to new replies.

About this Topic