Initial commit

This commit is contained in:
Mashiro 2019-10-25 20:11:58 +08:00
commit e5a069ee7e
4 changed files with 37 additions and 0 deletions

16
README.md Normal file
View File

@ -0,0 +1,16 @@
# Sakura 主题子主题
安装方法与普通主题相同,将 `Sakura-child` 文件夹上传到 `/wp-content/themes/` 目录即可,安装后启用 Sakura-child 主题。
之后你可以在子主题中添加自己的修改,这样父主题更新的时候,你的修改将会被保留。
用官方的话来讲:
> If you are making extensive customizations beyond styles and a few theme files creating a parent theme might be a better option than a child theme. Creating a parent theme allows you to avoid issues with deprecated code in the future. This needs to be decided on a case-by-case basis.
>
> 如果你的改动较大,不推荐子主题。此外子主题可能和今后的父主题不兼容。
关于子主体的更多说明可以参考:
- [简单的子主题教程(中文)](https://blog.wpjam.com/article/child-themes/)
- [详尽的WordPress子主题官方文档英文](https://developer.wordpress.org/themes/advanced-topics/child-themes/)

6
functions.php Normal file
View File

@ -0,0 +1,6 @@
<?php
add_action( 'wp_enqueue_scripts', 'Sakura_child_enqueue_styles' );
function Sakura_child_enqueue_styles() {
wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' );
}
?>

BIN
screenshot.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

15
style.css Normal file
View File

@ -0,0 +1,15 @@
/*
Theme Name: Sakura-child
Theme URI: http://childtheme-generator.com/
Description: Sakura-child is a child theme of Sakura, created by ChildTheme-Generator.com
Author: Mashrio
Author URI: http://childtheme-generator.com/
Template: Sakura
Version: 1.0.0
Text Domain: Sakura-child
*/
/*
Add your custom styles here
*/