【发布时间】:2017-03-04 20:20:57
【问题描述】:
我正在尝试创建一个 Wordpress 子主题,并且一直在访问以下网站:https://codex.wordpress.org/Child_Themes。
在这个网站上它说我必须创建两个文件,其中 style.css 很清楚,我的问题是关于 functions.php。它说有时我必须将以下文本复制粘贴到新创建的functions.php文件中:
<?php
function my_theme_enqueue_styles() {
$parent_style = 'parent-style'; // This is 'twentyfifteen-style' for the Twenty Fifteen theme.
wp_enqueue_style( $parent_style, get_template_directory_uri() . '/style.css' );
wp_enqueue_style( 'child-style',
get_stylesheet_directory_uri() . '/style.css',
array( $parent_style ),
wp_get_theme()->get('Version')
);
}
add_action( 'wp_enqueue_scripts', 'my_theme_enqueue_styles' );
?>
我想知道我必须在这个 php 文件中的什么地方进行修改,即我应该将我的主题名称放在功能中的什么位置?
谢谢,
纳温
【问题讨论】: