子主题的Wordpress子主题 [英] Wordpress child theme of a child theme

查看:132
本文介绍了子主题的Wordpress子主题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的主题已经是其父主题的子主题. 由于我想进行一些更改,因此我想制作一个儿童主题.

I'm using a theme what already is a child-theme of it's parent theme. Since I would like to make some changes, I want to make a child-theme.

如何为儿童主题制作儿童主题?

How to make a child theme for a child theme?

推荐答案

您通常无法正常创建孙子"主题-即使其成为子主题的子主题.从技术上讲,这可能是可能的( Smashing Magazine 表示它早在2013年),但似乎通常被认为不是"WordPress合法".

You can't really create a "grandchild" theme in the normal sense - i.e make it the child theme of a child theme. It might technically be possible (Smashing Magazine said it was back in 2013) but it seems to be generally considered to be not "Wordpress legit".

您可以做的是将孙子主题创建为插件-尽管请注意,由于这表明体系结构不佳,以及是否需要孙子主题,因此通常认为这是不好的做法出事了".但是,如果您使用的第三方主题本身就是子主题,那么我可以理解这一逻辑.

What you can do is create the grandchild theme as a plugin - although be aware that it tends to be considered as bad practice because it's an indication of bad architecture, and if you need a grandchild theme "something is wrong". However I can see the logic if you are using a third party theme that is itself a child theme.

您应该使用孙子主题吗?

孙子主题的主要实际困难是它们在您的站点中增加了另一层活动部件",使维护和调试更加困难.

The main practical difficulties with grandchild themes are they they adds another level of "moving parts" into your site, making it more difficult to maintain and debug.

我下面列出的参考文献讨论了孙子主题的实用性和缺点,因此您可以决定是否仍然可以选择这种方式:

The references I've listed below discuss the practicalities and disadvantages of grandchild themes, so you can decide if this is still an option for you:

  • WP Smith: A Theme Framework, Child Themes, & Grandchild Themes
  • Justin Tadlock:
  • Tom J. Nowell's answer on wordpress.stackexchange.com to the question "Is it possible to make grandchild themes?"


如何使用插件创建孙子主题":

如果您决定采用这种方式,以下内容将介绍如何为孙子主题"创建插件

If you decide that this is the way to go, the following describe how to go about creating a plugin for your "grandchild theme"

AppThemes:创建孙子主题

孙子主题的替代项:

另一个建议是复制子主题以进行自定义,尽管这意味着升级子主题不再容易.

Another suggestion is to make a copy of the child theme to customise, although this means it's no longer easy to upgrade the child theme.

本文提供了一种编辑子主题的方式,该方式是"最大程度地减少您所做的更改与原始子主题之间的耦合"……这意味着您不需要孙子主题和对子主题的更改(希望)应该最少,以使其更易于升级.

This article offers a way of editing the child theme in a way that "minimizes the coupling between the changes you make and the original child theme" ...meaning you don't need a grandchild theme and the changes to your child theme should (hopefully) be minimal, making it easier to upgrade.

这篇关于子主题的Wordpress子主题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆