【发布时间】:2018-03-24 10:37:05
【问题描述】:
我想在 Wordpress 中为二十五岁创建一个子主题,其中包含来自父主题的多个样式表文件。 路线是 htdocs/wordpress-1/wp-content/themes/twentyfifteen-child 所以根据这里的类似问题,孩子的代码应该是:
style.css:
/*
Theme Name: Twenty Fifteen Child
Theme URI: http://localhost/wordpress-1/wp-content/themes/twentyfifteen-child/
Description: My first child theme, based on Twenty Fifteen
Author: Daniel Pataki
Author URI: http://danielpataki.com
Template: twentyfifteen
Version: 1.0.0
Tags: black, green, white, light, dark, two-columns, three-columns, left-sidebar, right-sidebar, fixed-layout, responsive-layout, custom-background, custom-header, custom-menu, editor-style, featured-images, flexible-header, full-width-template, microformats, post-formats, rtl-language-support, sticky-post, theme-options, translation-ready, accessibility-ready, responsive-layout, infinite-scroll, post-slider, design, food, journal, magazine, news, photography, portfolio, clean, contemporary, dark, elegant, modern, professional, sophisticated
Text Domain: twenty-fifteen-child
*/
functions.php:
<?php
function enqueue_parent_styles() {
wp_enqueue_style( 'twentyfifteen-editor-style', get_template_directory_uri().'css/editor-style.css',array(), null, 'all' );
wp_enqueue_style( 'twentyfifteen-ie', get_template_directory_uri().'css/ie.css',array(), null, 'all' );
wp_enqueue_style( 'twentyfifteen-ie7', get_template_directory_uri().'css/editor-ie7.css',array(), null, 'all' );
wp_enqueue_style( 'twentyfifteen-style', get_stylesheet_uri(), '', null, 'all' );
}
add_action( 'wp_enqueue_scripts', 'enqueue_parent_styles' );
?>
父内容(用于样式表)的路径是: htdocs/wordpress-1/wp-content/themes/twentyfifteen/css 但仍然在主题选择页面中没有子主题的预览,并且在加载主题时没有从父主题(二十五)加载的 CSS 规则。我找不到问题,如果有人可以帮助我..
【问题讨论】:
-
有一个WordPress问题的网站:wordpress.stackexchange.com