WordPress.org

Ready to get started?Download WordPress

Forums

Page Templates in WordPress 2.5?! (57 posts)

  1. webwisedesign
    Member
    Posted 6 years ago #

    Figured out a "cure". Placed my developed theme in the default theme directory (is this illegal?). Everything works now!

  2. apad
    Member
    Posted 6 years ago #

    I got the same problem also but after careful explanation form the moderator, it is clear that we should put the code at the top of the file exactly like this:

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

    not like this:

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

    or this:

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

    Just make sure there are exactly 5 line of PHP nifty..
    Cheers

  3. honewatson
    Member
    Posted 6 years ago #

    Naming the file exactly the same as the template name worked for me.

  4. AzureCrystal
    Member
    Posted 6 years ago #

    WordPress newbie here, but PHP vet, I just started playing with WordPress so my 1st version was 2.5, I made the test.php file mentioned here, it does show up in my list of page templates :)

    P.S. I wanted to love MODx, but I've been having way too much fun with WP, and it is better documented and supported !! Plus my clients will not grok MODx, but they will LOVE WPs simple admin interface...

  5. brokencode
    Member
    Posted 6 years ago #

    Problem solved. thank you all. no need thinking about coding cause I'm not the expert. Just switch to default and back to previous theme. Show up!

  6. mantis2008
    Member
    Posted 6 years ago #

    Hi Guys -

    When you make these templates, apart from the 5 lines starting at the top
    <?php
    /*
    Template Name: My Template name
    */
    ?>

    also make sure you are saving the template file with the correct line endings. I made this mistake in TextMate on OS X - my preferences were set to save as 'CR (Max OS Classic)' - when in fact it should have been 'LF' which is more universal.

    once i opened all my templates and re-saved them, everything reverted back to ok.

    Note - you may need to swap theme to default and then back again just to reset things.

    Hope this helps.

  7. okpeery
    Member
    Posted 6 years ago #

    Something I noticed earlier was that someone called their page template

    page test.php

    I don't know much about php but with html files you cannot have a space in the name, maybe that is why it didn't show up.

    I have never done this procedure before, but I did it earlier this afternoon, I'm in France so it is already evening, and it took a little figuring out but it worked fine for me.

    If anyone is still reading this I have a related problem.

    I made my page fine, but I wanted this custom page not to have a sidebar so I just deleted the line of code in the custom page template calling the sidebar, I thought I was so clever, well the footer doesn't want to stay on the bottom anymore.

    Do I have to modify then the css and make a separate custom css file for this too? Please just tell me I did something stupid and it can be fixed easily.

    What I am trying to do is have a bunch of custom pages that will contain only text and affiliate links, sort of like landing pages, that do not have a sidebar. I want the text and images and links to spread out across the whole page. They also are set to private so they don't display in the menu on my main page. Can someone take a look at what is happening and give me some advice?

    http://francetales.com/testing

    Look at the home page
    http://francetales.com
    to see where the footer should fall

    Thanks for the help.

  8. Brayne
    Member
    Posted 6 years ago #

    I started to pull out hair on this also... My fix was changing the permission on the theme folder itself to 755. The files were at 644.
    So....
    wp-content/themes/default....
    wp-content/themes/bright....
    wp-content/themes/dark....
    wp-content/themes/something-borrowed....

    default,bright,dark,something-borrowed were all put to 755 and my page templates showed up nicely in the lower area under Advanced Options.

    Hope this helps someone!

  9. mhowellsmead
    Member
    Posted 6 years ago #

    Definite solution for 2.5.1, just implemented:
    - add correct comment as detailed earlier in this thread.
    - ensure at least one Page template present in folder.
    - ensure rights set to 775
    - switch to default theme and then back again.

    After doing these things, the pulldown was visible, where it should be.

  10. ericjeckert
    Member
    Posted 6 years ago #

    this was really torking me off until i found this thread. switching the themes back and forth is what did the trick for me. thanks for the help.

  11. adi8
    Member
    Posted 6 years ago #

    Switching themes temporarily, worked for me too..

  12. Joni
    Member
    Posted 6 years ago #

    When you get weirdness like that, you can sometimes blame your internet service provider. If you've cleared your browser's cache, and closed and reopened the browser, and you still have problems, go to the command prompt (in Windows, Start, Run, Cmd), and type this:
    ipconfig /flushdns

    That usually clears everything up.

  13. signal_oil_and_gas_company
    Member
    Posted 6 years ago #

    Hmm, it should work with details these guys gave you.
    Try everything from the begining.

    Signal Oil and Gas

  14. marko3662
    Member
    Posted 6 years ago #

    In my case switching themes worked, because in default theme there are two page templates, but in my theme there was only one (page) template.

    When I created additional templates, also "Page template" field appeared.

    I looks like WP doesn't show this option if there is only one template in the theme. This one is chosen by default...

  15. rexreed
    Member
    Posted 6 years ago #

    I've tried all these suggestions, but nothing is working for me... how can I diagnose the problem?

  16. rexreed
    Member
    Posted 6 years ago #

    OK - I think I figured it out in my case... I had a plug-in called Role Scoper that seemed to be killing the Page Template option. Not sure why, but it does.

  17. kb241
    Member
    Posted 6 years ago #

    It only worked for me when I switched my theme and then switched it back. Then the Page Template dropdown appeared when editing my pages. This is kind of weird, but it worked.

  18. kevinB
    Member
    Posted 6 years ago #

    I fixed Role Scoper's Page Template bug shortly after Rex reported it to me. kb241's might have been caused by something else, though.

    Everyone is welcome to submit Role Scoper bug reports or other concerns/questions in the Agapetry Support Forum.

  19. Andy Potanin
    Member
    Posted 6 years ago #

    I had the same problem.

    Switching to a different template and then back to the one you are working with fixed the problem for me.

    Good call kb241.

  20. Frank McClung
    Member
    Posted 6 years ago #

    I had the same problem in WP 2.6.1 with my page template field magically disappearing. I went to the Design tab and found that WP had somehow deactivated my current theme. Reactivated it and viola.

  21. Joseph
    Member
    Posted 5 years ago #

    I have the same problem, tried everything mentioned here and it still now works. I do not see my theme to select it.

  22. Joseph
    Member
    Posted 5 years ago #

    Any fix for this?

  23. Samuel Wood (Otto)
    Tech Ninja
    Posted 5 years ago #

    There's no fix because there's no bug to fix. This code has not changed at all, for several versions. If the page template is not showing up, then something is wrong with the template or the theme itself. WordPress can't do things magically.

    You need to figure out what's wrong with your Template and fix it. That's all there is to it, really.

    Some people have luck with switching to default theme and back again, and while that doesn't make any sense to me, if they say it worked for them then I'm not one to argue. Other than that, I have no suggestions for you.

  24. Melton Cartes
    Member
    Posted 5 years ago #

    Switching to Default and then back to my Theme worked.
    Thanks!

  25. MartyThornley
    Member
    Posted 5 years ago #

    I know others have said it but...

    Switch to Default Theme and then switch back.

    I now see the template drop down.

    Thanks to all the others who suggested it!

  26. prw
    Member
    Posted 5 years ago #

    ive been having this problem in 2.7, 2.7.1 as well.

    for no reason the template drop down within the "attributes" pane just vanishes on refresh. then a random ammount of time later, on a page refresh, or when the theme is switched, it just comes back.

    This would be less of a problem if the bug didnt make the page use the default template for every page untill the template attribute drop down comes back.

    i think its short sighted to say that all the people who have had this problem, me included, have bad code(even though the code itself is 5 lines and almost impossible to mess up), when it does it, seemingly at random.... there is a bug within wordpress.

  27. curtdp
    Member
    Posted 5 years ago #

    One of the things, that we all need to do, is reactivate our wordpress themes in admin->themes

    I think it's not a bug, but it's a feature of theming system's of all CMS. How CMS can understood, that we uploaded some new template files, without reactivating of theme?

Topic Closed

This topic has been closed to new replies.

About this Topic