Template Dropdown not showing up within Wordpress

2019-03-12 15:52发布

I am working on a Wordpress-based project, and I just added a new template to the installation by uploading a template file. I was creating a new page that will use my new template, when suddenly, the "Template" dropdown in the "Page Attributes" box is gone.

I am using Wordpress 3.0.1.

Update: I saw a site which told me to revert to the default template, and back to my custom template. Apparently it worked, but I am still baffled on what triggers this bug. Also, any additional knowledge or pointers on this bug would be a great help since my job requires me to patch this (and possibly submit the bug fix to Wordpress). Thanks!

16条回答
疯言疯语
2楼-- · 2019-03-12 16:31

I had the exact same problem with WordPress 3.2.1. I added a new template and the menu disappeared from the page add/edit screen. The solution was to switch back to the default twentyeleven theme end then right back to my custom theme. The templates drop-down began appearing again.

BTW, you said "revert to the default template, and back to my custom template" but I'm pretty sure you meant theme. I'm guessing where you saw this was here:

http://wordpress.org/support/topic/template-file-drop-down-not-appearing

Looks like this bug has existed for a couple of years at least. I filed a report: http://core.trac.wordpress.org/ticket/18324

查看更多
Ridiculous、
3楼-- · 2019-03-12 16:35

Morichika is spot on. I had the same problem, but then it sorted itself out by doing:

<?php
    /**
    * Template Name: Front Page
    */
?>
查看更多
Ridiculous、
4楼-- · 2019-03-12 16:35

I know is super late for this question, but I fix it adding

Version: 0.1 alpha

in the comments of the themeFolder/style.css

This is my style.css complete for my theme

/*
  Theme Name: Stockout Theme
  Theme URI: http://stockout.com.uy/myTheme
  Author: MauriPastorini
  Author URI: http://stockout.com.uy
  Description: This is a theme for stockout page
  Version: 0.1 alpha
*/

I hope someone find this useful

查看更多
霸刀☆藐视天下
5楼-- · 2019-03-12 16:36

I found the root of the problem. It is the style.css file inside the theme root.

  1. It must be in "UNIX encoding".

  2. It must have all comments with "Theme Name", "Version", etc.

查看更多
登录 后发表回答