llbaird
Forum Replies Created
-
Forum: Developing with WordPress
In reply to: WP 5.6 Parent and Child ThemeThanks for your help everyone! It seems my space between Template: twentytwenty was two spaces. Replacing it with a single space solved the issue. However, errors still appeared until I activated a different theme, then reactivated a child theme, so it took me longer to tell that that was the fix.
Forum: Developing with WordPress
In reply to: WP 5.6 Parent and Child Theme/* !
Theme Name: Twenty Twenty Child
Text Domain: twentytwentychild
Template: twentytwenty
Version: 1.2
Requires at least: 4.7
Requires PHP: 5.2.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.htmlAll files, unless otherwise stated, are released under the GNU General Public
License version 2.0 (http://www.gnu.org/licenses/gpl-2.0.html)This theme, like WordPress, is licensed under the GPL.
Use it to make something cool, have fun, and share what you’ve learned
with others.
*/
I’ve just confirmed that this header works (i.e. WordPress Dashboard detects it as Theme name: (‘s child)) before another theme is Activated in the Dashboard. When another theme is activated, then the same child is Activated again, the Dashboard detects it as Theme name: (NOT a child theme).Forum: Developing with WordPress
In reply to: WP 5.6 Parent and Child ThemeI’m now noticing that WordPress (in the Dashboard) is detecting these child themes as Theme name: (NOT a child theme). If the themes is incorrectly treated as a parent theme, that would cause these issues. Other than the style.css Template, what would cause WordPress to interpret a (child) theme as a parent (not a child)? Put another way, can I force WordPress to recognize a theme as a child theme (aside from using style.css Template, which is already in place).
- This reply was modified 5 years, 1 month ago by llbaird.
Forum: Developing with WordPress
In reply to: WP 5.6 Parent and Child ThemeI could have phrased that clearer. No, the parent reference in the child style.css remains twentytwenty (Template: twentytwenty). By applying another theme, I meant in the WordPress admin GUI/Dashboard, going to Appearance/Themes and clicking the Activate button on another theme, then clicking Activate on the initial child theme.
Forum: Developing with WordPress
In reply to: WP 5.6 Parent and Child ThemeThe child theme was just relying on automatic loading/convention to load the parent classes. I’d like to find out more about how the parent-child conventions for classes work. Thanks for your help!
Forum: Developing with WordPress
In reply to: WP 5.6 Parent and Child ThemeYes, I can confirm it is using the enqueue method for the stylesheets. The errors are php errors, and persist across browsers (even with browser caches cleared).
However, looking more closely at the enqueue process, it is interesting to observe that it uses get_template_directory_uri(), which appears to return /wp-content/themes/twentytwenty-child after switching themes and /wp-content/themes/twentytwenty before. Adjusting the style enqueue so far has not helped with class inheritance.
So there does seem to be some change in interpretation of the template directory, which I am guessing is related to the issues with class inheritance. Does anyone have more information about how this might impact classes (and how to fix it)?
My apologies for not clarifying – this question is mainly about PHP classes and their inheritance, not CSS classes.- This reply was modified 5 years, 1 month ago by llbaird.