如何创建一个WordPress子主题

2024-11-04 09:31:53

1、在主题目录下创建一个新的文件夹。

2、在上面创建的主题文件夹下创建style.css ,并声明为某个主题的子主题。一个简单例子如下:

3、/*Theme Name: My Child ThemeTheme URI: http: //e垓矗梅吒xample.com/Description: C茑霁酌绡hild theme for the Twenty Ten themeAuthor: Your nameAuthor URI: http: //example.com/about/Template: twentytenVersion: 1.0.0*/

4、上面的内容很简单,做过主题的朋友都看得懂,只有一句最为关键:Template: twentyten声明了该主题为twentyten的子主题,可以使用twentyten的所有东西。

猜你喜欢