当前位置: 动力学知识库 > 问答 > 编程问答 >

css - How to create a child theme in WordPress?

问题描述:

I am trying to create a child theme so I can customize the parent theme but it is not working what-so-ever. I did everything I can think of:

  1. created a folder for my child theme under wp-content/themes
  2. created a style.css stylesheet and saved it in the child theme folder:

    /*

    Theme Name: Twenty Thirteen Child Theme

    Description: Twenty Thirteen Child Theme

    Author: Ashley

    Template: twentythirteen

    Version: 1.0.0

    */

  3. and I went to Appearance > Themes in WordPress but no child theme showed up. I have tried it multiple times and don't know what to do.

网友答案:

Pretty good tutorial here: https://www.elegantthemes.com/blog/resources/wordpress-child-theme-tutorial. I've taken a snippet from it for the style.css file, and substituted bits with your info:

/*
 Theme Name:   Twenty Thirteen Child Theme
 Description:  Twenty Thirteen Child Theme
 Author:       Ashley
 Template:     twentythirteen
 Version:      1.0.0
*/

@import url("../twentythirteen/style.css");

/* =Theme customization starts here
------------------------------------------------------- */

Be sure to link properly to the TwentyThirteen theme's style.css file (via @import); make sure you're using the right path. Then you can proceed as normal by visiting "Appearance > Themes".

分享给朋友:
您可能感兴趣的文章:
随机阅读: