WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] [closed] WordPress 3.4 Bug - Page Templates (61 posts)

  1. 1stpage
    Member
    Posted 1 year ago #

    Hi,

    For some time I have been experiencing a bug with WordPress not showing the Page Templates dropdown on the page editor. I have been able to resolve this by deactivating and reactivating my theme. Not sure why this worked, but it was suggested in threads here and sure enough it works.

    Now, I have upgraded to WordPress 3.4 and everything else being the same but now the technique above no longer works to restore the Page Template dropdown. I have no way to use page templates now at all.

    Any thoughts?

  2. mindctrl
    Member
    Posted 1 year ago #

    Do you see the box called "Page Attributes"? If not, click "Screen Options" at the top right, and select the "Page Attributes" box.

  3. Link please? I suspect it's your theme but a link would help.

    In the meanwhile have you tried:

    - deactivating all plugins to see if this resolves the problem. If this works, re-activate the plugins one by one until you find the problematic plugin(s).

    - switching to the Twenty Eleven theme to rule out any theme-specific problems.

    - resetting the plugins folder by FTP or PhpMyAdmin. Sometimes, an apparently inactive plugin can still cause problems.

    - re-uploading the wp-admin and wp-includes folders from a fresh download of WordPress.

    Edit: mindctrl is on to it, that should have been my suggestion too. ;)

  4. 1stpage
    Member
    Posted 1 year ago #

    Thanks for the tips!

    Yes, Page Attributes is checked on and I can see the Page Parent and Order, just not page templates.

    I am actually developing a custom theme, so I can't switch :-) Do you know what part of the theme would cause this conflict? If the problem exists on my end, I need to fix it.

    Also, no plugins are activated.

    For now, I just entered the page template in to the SQL database directly, although I need to figure it out especially if you think it could be the theme Im working on.

    I'll give the other suggestions a try as well and post back.

  5. mindctrl
    Member
    Posted 1 year ago #

    Do your page templates have the name in the top? Similar to this:

    <?php
    /*
    Template Name: My Template Rules
    */
    ?>
  6. 1stpage
    Member
    Posted 1 year ago #

    Yes, they sure do. :)

    Also, its not that the templates dont show up in the dropdown, Im actually missing the entire dropdown it's self.

    Everything was working until I upgraded, and now even my workaround doesnt restore the Page Templates dropdown. Im stumped.

  7. mindctrl
    Member
    Posted 1 year ago #

    Interesting. Have you tried enabling debug to see if any errors are showing?

    In wp-config.php you can add the following lines and they'll show up on the screen and log to the wp-content/debug.log file.

    define('WP_DEBUG', true);
    define('WP_DEBUG_DISPLAY', true);
    define('WP_DEBUG_LOG', true);
  8. mindctrl? Those are good suggestions. :)

    Along those lines: create a custom template just as above and call it my-template-rules.php and dump that into the wp-content/themes/twentyeleven/ directory. You can delete it later.

    Now switch to Twenty Eleven, check that the page attributes is still selected and see if you can select that template.

    It won't do anything, but being able to select it would be an improvement. If that works then it's probably your custom theme.

  9. 1stpage
    Member
    Posted 1 year ago #

    Ok, I just deleted my custom pages and then re-uploaded them. I didn't do anything else, just delete / reupload. And, it worked!

    That's mighty odd, but now I know my new workaround.

    Thanks everyone, I appreciate the help! :-)

  10. behrooz.tahanzadeh
    Member
    Posted 1 year ago #

    Hi! I have same problem with wordpress 3.4...
    Can explain how did you solve this problem?!

  11. 1stpage
    Member
    Posted 1 year ago #

    Sure, all I did was I logged in to my server with FTP, downloaded and deleted my custom page templates.

    Then, I simply re-uploaded them and refreshed the page.

    That was really all, but it solved the problem in my case.

  12. troyster
    Member
    Posted 1 year ago #

    Hi, I have this issue as well.

    @1stpage: Did delete my custom page files on the server and then re-upload -> didn't solve.

    Any other workarounds?

  13. behrooz.tahanzadeh
    Member
    Posted 1 year ago #

    My problem didn't solve too
    I use custom fields to change my _wp_page_template

  14. troyster
    Member
    Posted 1 year ago #

    @ behrooz.tahanzadeh

    Did you solve it with setting template in custom field?

    How did you do it?

  15. behrooz.tahanzadeh
    Member
    Posted 1 year ago #

    there's record in wp_postmeta that save page templates.
    It's meta_key is _wp_page_template and meta-value is name of template file for example

    page-sample.php

    but if you want to change it directly in custom field panel wordpress give and error that says you cant change it!

    To change this record directly in page editor I use Advanced Custom Fields plugin...

  16. troyster
    Member
    Posted 1 year ago #

    @ behrooz.tahanzadeh thanks...

    So do we haver to do a hack in order to get this work, or is there any better solutions?

  17. sam53
    Member
    Posted 1 year ago #

    Its happens with me also..

    I am using WordPress theme "Crea WP" and upgraded to wordpress 3.4
    and now i am not getting page templates drop down menu on making a new page.

    There are custom page templates in the theme like "contact page" & "Portfolio page"

    i switched the templates, plugins reactivated. but the drop down is not showing.

    Any one can help ?

  18. troyster
    Member
    Posted 1 year ago #

    @ All:

    I have tested the following without success:

    1) Change theme
    2) Create a new folder for custom page types and put them there
    3) Delete the custom page files on the server and then copy them over again...

    Anyone who had success, please share!!

  19. troyster
    Member
    Posted 1 year ago #

    This solution worked for me.... you have to declare the template name on a dedicated row.

    From:

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

    To:

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

  20. deadempire
    Member
    Posted 1 year ago #

    @troyster

    Nice work. This fix seems to be working for me also

  21. neonWired
    Member
    Posted 1 year ago #

    I had a similar issue with the 3.4 update, certain page templates were showing and others weren't, turns out it was the formatting in the php file

    <?php /*Template Name: 1 Column Page */ ?>

    Won't work

    <?php
    /*Template Name: 1 Column Page */
    ?>

    Will work.

    Apparently the newline is required in 3.4. This is a pretty silly bug that could potentially break thousands of themes which I hope will be fixed.

  22. shaunkrd
    Member
    Posted 1 year ago #

    Thanks for posting this fix which worked for me. Wasted an hour or so up to now trying to fix the backend of my sites.

  23. jaledwith
    Member
    Posted 1 year ago #

    This was very helpful. Thanks so much!

  24. Andrew Nacin
    Lead Developer
    Posted 1 year ago #

    Hello everyone,

    Sorry for your trouble on this one. You are right, <?php /* Template Name: ... on one line will not work in 3.4.

    This was not an intentional change, and will be fixed in 3.4.1. (You can find a bug report on this here: http://core.trac.wordpress.org/ticket/20955 )

    In the meantime, if you run into any issues with it not detecting a page template that isn't covered by the example above, please let us know. Thanks!

  25. junior89
    Member
    Posted 1 year ago #

    hi, our site is currently ineccessable as sub-pages cannot be clicked this is evidently after the upgrade we are using Modularity Lite as a theme i have tried the fix and the bug just isnt getting fixed i dont know if im am maybe doing it wrong but we have grow desperate pls help.

  26. neonWired
    Member
    Posted 1 year ago #

    @junior89 Unsure if this bug effects the front end display of templates or just the admin.

  27. junior89
    Member
    Posted 1 year ago #

    the front end and the admin, in the admin the section were you select pages is at the bottom of the page and the side bar with the options is stretched out and abnormal as the options are scarterd and as mentioned when one visits the site you can click on the pages infront such as ie. about us and contact but the sub-pages of that u cannot they do display but as you try to move the curser over a selection it all dissapears, i have currently changed themes as a test im using twenty eleven and it works fine but modularity lite is my problem

  28. junior89
    Member
    Posted 1 year ago #

    nope i was wrong it not just the modularity lite any theme i put on the pages section admin and front is not functioning correctly

  29. junior89
    Member
    Posted 1 year ago #

    but using firefox the front end of the site is perfectly fine but on ie its shocking

  30. shareAll
    Member
    Posted 1 year ago #

    Putting the template name on a dedicated line solved this issue for my custom template after upgrading to 3.4. Thanks troyster!

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

Topic Closed

This topic has been closed to new replies.

About this Topic