wordpress中子主题的url

wordpress中子主题的url,wordpress,Wordpress,我想在wordpress中创建一个网站,为此我选择了一个主题并创建了一个子主题 我将style.css和header.php复制到子文件夹中,因为我也想修改header。我修改了孩子的文件 在my style.css中,我添加了行模板:带有父主题的名称 /* Theme Name: Example Theme URI: http://www.woothemes.com/ Version: 1.2.15 Description: Designed by <a href="http://www

我想在wordpress中创建一个网站,为此我选择了一个主题并创建了一个子主题

我将style.css和header.php复制到子文件夹中,因为我也想修改header。我修改了孩子的文件

在my style.css中,我添加了行模板:带有父主题的名称

/*
Theme Name: Example
Theme URI: http://www.woothemes.com/
Version: 1.2.15
Description: Designed by <a href="http://www.woothemes.com">WooThemes</a>.
Author: WooThemes
Author URI: http://www.woothemes.com
Tags: woothemes
Template: mystile

  Copyright: (c) 2009-2011 WooThemes.
  License: GNU General Public License v2.0
  License URI: http://www.gnu.org/licenses/gpl-2.0.html

*/
我想要这个

http://localhost/.../wp-content/themes/example/images...
如果您需要任何想法,此函数将首先在子主题目录中进行检查,然后在父主题目录中进行检查。您正在使用的仅在父目录中检查


一句话:如果一个函数的行为不符合您的预期,请检查代码。很可能你会在那里找到原因。

添加到
函数。php

// create a URL to the child theme
function get_template_directory_child() {
    $directory_template = get_template_directory_uri(); 
    $directory_child = str_replace('storefront', '', $directory_template) . 'child-storefront';

    return $directory_child;
}

brasofolio是对的,请看这里:
http://localhost/.../wp-content/themes/example/images...
// create a URL to the child theme
function get_template_directory_child() {
    $directory_template = get_template_directory_uri(); 
    $directory_child = str_replace('storefront', '', $directory_template) . 'child-storefront';

    return $directory_child;
}