• Resolved Begin

    (@bentalgad)


    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 ?

Viewing 4 replies - 1 through 4 (of 4 total)
  • 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.

    Thread Starter Begin

    (@bentalgad)

    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…

    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.

    Thread Starter Begin

    (@bentalgad)

    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!!!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘cna’t add another template’ is closed to new replies.