• petetheprogrammer

    (@petetheprogrammer)


    Hello!

    I’ve grown up with classic themes and I understand the need for child themes there, as all the styling and templates of the parent might be lost with an update.

    However, I struggle a bit to understand the need for child themes with the new block themes and site-wide css. Isn’t all styling and the blocks now saved in the database? When exactly do we need child themes here? When we touch the functions.php? What’s the best practice here?

    And with the new theme export function – can’t I just export my settings and create a new theme that way, if necessary? An exported, renamed theme wouldn’t get updates anyway, would it?

    Maybe I have some misconception about where exactly the styling and the blocks are stored. Any clarification is certainly appreciated!

Viewing 5 replies - 1 through 5 (of 5 total)
  • This is a grey area. I originally hated Block Themes, but they are growing on me. It seems everything is a bit half-hearted with WP development these days and focused on the commercial.

    I found it confusing as to whether I needed a child theme or not when using a block theme. At the end of the day, you do.

    WP have moved from what most us know best to JS, and in fairness, it is brilliant. But when I’m building websites for charities or academic journals (believe me, I don’t get paid a dime for it!), it is a bit like hell working out what to do.

    I am not answering your question, just hoping for WP will provide actual, detailed documentation or introductions to their mind-boggling roadmap, so I am not always stuck in the middle – to code build or to block build. In fairness, I have my own personal plugin for all sites that fixes Gutenberg and Block Builder’s issues when I use them on the odd occassion.

    Sorry for that rant – seconding the question asked above!

    Moderator bcworkz

    (@bcworkz)

    Child block themes are rarely called for. All customization can usually be managed through a plugin or the site editor. One use case where child themes may make sense is if you’re a theme developer. You could build a base theme which contains all of your generic code. Then build various child themes with their own unique features, but they rely on the base theme as a sort of code library or framework.

    Even then, you could instead have generic theme files that get included in every theme you build instead of referencing a parent theme.

    @gasurgaelach — please refrain from chiming in on someone else’s topic unless you’re actually answering their question. Many regulars here use the No Replies view to find topics where help is still needed. When you add a non-answer reply to a topic, in that view it looks like the OP is being helped and people who might be able to actually answer will skip over the topic. Any sort of “me too” replies fail to comply with the forum guidelines.

    These forums are for asking and receiving assistance with WP sites. They are not for personal rants. If you wish to rant, that’s great, I encourage it, but not here. There are numerous social media sites for that, or you could build your own site where you’re the sole voice with no dissent. There is even some great software available that’ll help you do that ??

    No one would legitimately argue that WP documentation needs no improvement. Most devs dislike writing documentation. Documentation always falls behind the curve, especially when it depends on volunteers to produce it. If you are able to, you can contribute to improving documentation instead of complaining about it ?? Please refer to the Doc Team’s “Make” page. In particular, check out the onboarding link in the welcome section at the top.

    Thread Starter petetheprogrammer

    (@petetheprogrammer)

    Thank you both for providing your input on the question.

    So, @bcworkz , is it your understanding too, that if I use a block theme like twenty-twenty-five for a small website and I customize the look and feel only through the site editor or a plugin, these customizations would not be endangered by an update to the theme?

    If that is so, I really don’t see the point of a child theme here. But as child themes also to block themes are mentioned in the documentation, I was wondering if I missed something.

    The best practice for classic themes is to work with child themes. The best practice for block themes is…?

    Moderator bcworkz

    (@bcworkz)

    Your custom work in your own plugin, or in the site editor, is safe from all updates. The main reason for child themes is to allow one’s custom work to be safe from updates. With classic themes, child themes are principally useful for maintaining custom templates. Customization outside of templates can instead be managed with plugins.

    Except when custom templates are involved, I generally recommend a custom plugin instead of a child theme only because plugins are slightly easier for novices to create. How to enqueue custom styles in a child theme is somewhat confusing and varies by what the parent theme does or doesn’t do. But if you already have a child theme, there’s little reason to make a plugin as well.

    In theory, themes should focus on site layout and appearance. Plugins should focus on added or altered functionality, not appearance. But if you’re customizing your own site, maintaining that distinction is optional.

    The above pertains mainly to classic themes. With block themes, we are able to create templates in the site editor which are safe from updates, so one of the principal reasons for a child theme no longer apply. Most other customization can be implemented from a plugin. Never the less, someone might choose to use a custom block theme anyway. Perhaps to conform to the appearance vs. functionality distinction, or maybe they wish to significantly alter theme.json.

    There’s nothing wrong with creating a child block theme. I’m only saying that in many cases it’s not strictly necessary.

    Thread Starter petetheprogrammer

    (@petetheprogrammer)

    I just recently stumbled upon the new site editor export function. If you follow the documentation (https://developer.www.ads-software.com/themes/getting-started/quick-start-guide/#exporting-your-theme) you are able to export your changes to a theme zip file. My understanding is that after renaming the zip file and a few edits in the head of the style.css, you have your own custom block theme.

    I quite like that functionality for users who are maybe not as apt with creating either their own plugin or a child theme. Or for cases as @gasurgaelach mentioned, where you work pro bono, time is a factor and not many changes are needed.

    So for myself I concluded that when working with block themes I myself would be using either a child theme, a custom theme or a custom plugin. When time is of the essence or for folks with less experience a quick way to a custom theme is through the export function.

    Any thoughts to add? If not, I will mark as resolved. Thank you all for your input! I appreciate it!

Viewing 5 replies - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.