我已经安装了WordPress和Zerif的最新版本。我没有改变它们。我在主题文件夹中创建了一个名为的目录。我做了一个functions.php文件。functions.php文件中的代码是从这里复制的:http://docs.themeisle.com/article/14-how-to-create-a-child-theme。我还创建了一个style.css文件。这是它的代码:
/*
Theme Name: Zerif Lite Child
Theme URI: N/A
Description: Zerif Lite Child Theme
Author: Jacob Franklin
Author URI: http://www.jacobrfranklin.com
Template: zerif-lite
Version: 0.1
License: GNU General Public License v3
License URI: http://www.gnu.org/licenses/gpl-3.0.html
Tags: one-column, two-columns, right-sidebar,front-page-post-form,full-width-template,rtl-language-support,sticky-post,theme-options, custom-background, custom-menu, editor-style, featured-images, threaded-comments, translation-ready, footer-widgets, portfolio
Text Domain: zerif-lite-child
*/
#carousel-homepage-latestnews .item .latestnews-box:nth-child(4n+1) .latestnews-title a:before {
background-color: #0d6860;
}
.navbar-nav>li>a {
color: #7b7b7b;
}
.navbar-inverse .navbar-nav>li>a:hover, .navbar-inverse .navbar-nav>li>a:focus {
color: #0d6860;
}
.company-details a:hover,a:focus,a:active {
color: #ffffff;
}
.red-btn{
background-color:#bf8003;
}
.green-btn{
background-color:#0d6860;
}
.red-btn:hover{
background-color:#fcb72c;
}
.green-btn:hover{
background-color:#19c2b4;
}我还在仪表板的定制部分(在外观下)定制了一些东西。我的style.css文件中的css没有一个被应用。我相信这个错误可能是显而易见的或者是愚蠢的,但我就是搞不明白。当我在简单的自定义css插件中使用时,完全相同的CSS在我制作子主题之前工作得很好,但是我更愿意做一个正确的子主题。请帮帮忙。
发布于 2016-07-07 21:34:49
看起来,你复制的代码缺少了将子主题样式实际添加到WordPress中的部分。他们跳过这件事有点奇怪,小心!
在WordPress法典中关于儿童主题的文章中,您只需要修改您的样式入队函数,因此它包括以下内容:
wp_enqueue_style( 'child-style',
get_stylesheet_directory_uri() . '/style.css',
array( $parent_style )
);您将希望在已经存在的wp_enqueue_style()调用之后将其直接放在代码中。
除非有别的地方出了问题,这应该是现在所需要的,但也许值得看一看“法典”的那篇文章,看看还有什么你可能还没有做过的事情。
https://wordpress.stackexchange.com/questions/231742
复制相似问题