• I have one site using my custom theme that displays the files under ‘Appearance | Theme File Editor’ using a description, followed by the file name, indented, such as

    Theme Functions
    (functions.php)

    and another that simply lists the file names, thus:

    functions.php

    Thoughts on what might be causing this? The file headers appear identical except the theme name.

    The page I need help with: [log in to see the link]

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter spinhead

    (@spinhead)

    I got an email with a reply that isn’t visible here for some reason.

    WordPress reads the theme’s main stylesheet header specifically the Theme Name, Description, Author, and other meta fields and uses that information to generate the “friendly labels” you see above certain files . . . So the reason one of your themes displays descriptions and the other does not is simply that their style.css headers aren’t equally detailed. Adding a fuller header especially including a Description—to the theme that only shows plain filenames will make WordPress display the files in the same labeled format

    In both themes, style.css contains identical sets of information, different only in the theme names and descriptions.

    This is the one that works

    Theme Name: arthenge
    Theme URI: https://spinhead.com/
    Author: Joel D Canfield
    Author URI: https://spinhead.com/
    Description: custom theme for my personal site
    Text Domain: arthenge
    arthenge is based on Underscores https://underscores.me/, (C) 2012-2020 Automattic, Inc.

    This is the one that doesn’t

    Theme Name: taaskaal
    Theme URI: https://spinhead.com/
    Author: Joel D Canfield
    Author URI: https://spinhead.com/
    Description: Minimal base to create workable custom themes for spinhead clients. Taaskaal is Navajo for oatmeal.
    Text Domain: taaskaal
    taaskaal is based on Underscores https://underscores.me/, (C) 2012-2020 Automattic, Inc.

    Moderator threadi

    (@threadi)

    This output has nothing to do with the contents of the files. It is determined based on the file names and the location of the file.

    Here is the relevant section in WordPress Core that determines this: https://github.com/WordPress/WordPress/blob/master/wp-admin/includes/file.php#L80

    For files that are part of the WordPress standard, the descriptions are displayed if they are located in the main directory of the theme. I can’t say why this isn’t happening with your theme. Presumably, the PHP check doesn’t detect that the file is located in the main directory. The reason could be, for example, that the file is actually located in a subdirectory of the theme or that there are path problems in the file system, which prevent PHP from reading it correctly.

    Tip 1: Check carefully whether the functions.php file is really not located in the main directory of the second project.

    Tip 2: Install the theme from the second project in the first project without activating it there. Then open the file editor and switch to the now installed theme (it will not be activated). If the output is different there, the difference could be due to something in the second project. Either path problems, as mentioned, or a different PHP version.

    Overall, however, this is not something you need to worry about.

    Thread Starter spinhead

    (@spinhead)

    I understand nothing is actually broken, but since I created this theme, I want to understand what’s happening. Two supposedly identical installs should behave identically.

    Both are in wp-content/themes/[theme-name]

    Installing the working theme on the other site causes it to fail in the same way.

    Both sites are on my hosting block using identical PHP settings.

    Moderator threadi

    (@threadi)

    Then it could have something to do with the way PHP recognizes paths. Are the absolute paths exactly the same down to the last character (apart from vhost specifications)? There may be an extra character somewhere that is causing this. Ultimately, it is not WordPress but PHP’s own pathinfo() function that reads the path.

    Thread Starter spinhead

    (@spinhead)

    Everything about these two sites is identical as far as I can tell, which is why the different behavior is confusing.

Viewing 5 replies - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.