Forums

[resolved] cna't add another template (5 posts)

  1. Begin
    Member
    Posted 2 years ago #

    I have added a few page templates by adding:

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

    to the top of the page and I used them and they work great,
    but now I am trying to add another template in the same method and
    it dosen't work.

    is there a limitition to the number of templates you can add ?

  2. Frumph
    Member
    Posted 2 years ago #

    No, no maximum as far as I know - but generally if you're template list is empty it means the theme isn't set, which happens when you edit the style.css file with either new revision or renaming of the theme. So go to appearance -> themes and first check if your theme is active correctly.

  3. Begin
    Member
    Posted 2 years ago #

    no, the template list isn't empty all my custom templates
    are showed in the list and working,
    only new ones I add dosen't show up...

  4. Frumph
    Member
    Posted 2 years ago #

    Again, maybe I didn't word it right.

    the function get_page_templates() in theme.php in wp-admin/includes is what is called to find all the templates that you have, there is no limit.

    However:
    function get_page_templates() {
    $themes = get_themes();
    $theme = get_current_theme();

    If will *not* find new theme files if 1) your directory information is cached somehow or 2) your theme is different now then it was when you generated the theme template list previously to you finding it broken.

    So I would think switching themes and checking the templates on another theme and switching back would be one solution else if it's still the same I would check what cache'ing you have going on. PHP Speedy would cause this to happen, maybe a few others.

  5. Begin
    Member
    Posted 2 years ago #

    oh thank's,

    actully Iam really a beginner so I didn't understand anything,
    from what you said :-), excepet the switching themes idea,
    and it WORKED!

    THANK's!!!

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags