现在,我有一个网站正在使用Genesis主题。我正在尝试创建一个儿童主题,但我不想经历所有这方面的工作。目前,我已经下载了一个普通的主题——gridz,我想把它变成一个子主题。
到目前为止,我尝试的是添加Template: genesis 到样式的底部。css头部,如下所示。
/*
Theme Name: Gridz
Theme URI: http://appswp.net/gridz-wordpress-theme/
Author: AppsWP
Author URI: http://www.appswp.net
Description: Pinterest like personal blogging theme powered by jQuery Masonry. Beautiful retina-ready and responsive theme with flexible layout. Tons of options to customize the theme according to your needs
Version: 1.0.5
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Tags: light, white, one-column, two-columns, right-sidebar, left-sidebar, fluid-layout, responsive-layout, custom-colors, custom-background, custom-header, custom-menu, editor-style, featured-images, post-formats, sticky-post, translation-ready, theme-options
Text Domain: gridz
Template: genesis
*/
当我安装主题时,它会注册为主题。然而,当我尝试激活主题时,整个网站都会出现一个
HTTP 500 error
.
我觉得这个问题似乎来自于功能。php,但我不知道问题出在哪里。现在,功能。php文件的长度超过800行,但我将只显示一个函数,因为它可以帮助您了解导致此错误的原因。
/**
* Filters Title for the Site
*/
function gridz_filter_wp_title($title) {
$site_name = get_bloginfo(\'name\');
if(trim($title) != \'\') {
$title = str_replace(\'»\',\'\',$title);
$filtered_title = $title.\' | \'.$site_name;
} else
$filtered_title = $site_name;
if (is_front_page()) {
$site_description = get_bloginfo(\'description\');
if(trim($site_description) != \'\')
$filtered_title .= \' | \'.$site_description;
}
return $filtered_title;
}
另请注意,每个页面的顶部都有一些代码:
/**
* @package gridz
*/
我已经尝试删除上面的代码,但仍然发生内部服务器错误。目前,我不知道下一步该做什么。