[wp-trac] [WordPress Trac] #35286: Broken theme error message is very confusing

WordPress Trac noreply at wordpress.org
Wed Jan 6 18:28:08 UTC 2016


#35286: Broken theme error message is very confusing
-------------------------------------+-----------------------------
 Reporter:  mayukojpn                |       Owner:
     Type:  enhancement              |      Status:  new
 Priority:  normal                   |   Milestone:  Future Release
Component:  Themes                   |     Version:  trunk
 Severity:  normal                   |  Resolution:
 Keywords:  ux-feedback needs-patch  |     Focuses:  administration
-------------------------------------+-----------------------------

Comment (by mayukojpn):

 Replying to [comment:5 swissspidy]:

 Thank you for reviewing!

 I'm sorry, I wrote wrong.
 Now I realize that it will work if there are index.php without template
 tag in style.css. Because WordPress will understand the theme as not a
 child theme!

 My point was '''the original message was not friendly for people who is
 building a child theme.''' Actually child theme can work without any PHP
 file inside it (And I always do that).


 [http://codex.wordpress.org/Theme_Development#Template_Files_List Codex]
 says:

 >'''index.php'''
 >The main template. If your Theme provides its own templates, index.php
 must be present.


 `theme_no_index` error checks if there are `index.php` '''OR''' template
 tag in a `style.css` header.

 {{{#!php
 <?php
 if ( ! $this->template && ! ( $this->template = $this->headers['Template']
 ) ) {
         $this->template = $this->stylesheet;
         if ( ! file_exists( $this->theme_root . '/' . $this->stylesheet .
 '/index.php' ) ) {
                 $this->errors = new WP_Error( 'theme_no_index', __(
 'Template is missing.' ) );
                 $this->cache_add( 'theme', array( 'headers' =>
 $this->headers, 'errors' => $this->errors, 'stylesheet' =>
 $this->stylesheet, 'template' => $this->template ) );
                 return;
         }
 }
 }}}


 My request looks getting harder... but it could be `Template file or tag
 is missing` or like that? Is it too much for this small column? I
 understood we couldn't separate message for independent theme and child
 theme. :(

--
Ticket URL: <https://core.trac.wordpress.org/ticket/35286#comment:6>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list