- 首页
- PHP
- WordPress 主题“错误:主题将自身定义为其父主题.请检查模板标题."
WordPress 主题“错误:主题将自身定义为其父主题.请检查模板标题."
[英] WordPress Theme "ERROR: The theme defines itself as its parent theme. Please check the Template header."
本文介绍了WordPress 主题“错误:主题将自身定义为其父主题.请检查模板标题."的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在我的 WordPress 网站的主题区域中,我收到奇怪的消息 - 错误:主题将自身定义为其父主题.请检查模板标题."我无法弄清楚什么是错的.请帮我.
header.php 文件代码如下:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><头><title><?php wp_title( '|', true, 'right' );?></title><?php wp_head();?><link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>"/><link rel="icon" type="image/png" href="<?php bloginfo('stylesheet_directory'); ?>/Images/favicon.gif"/><link rel="stylesheet" href="<?php bloginfo('stylesheet_directory'); ?>/Font/font-awesome-4.0.3/css/font-awesome.min.css">头部><body class="custom-background"><div id="包裹"><div id="标题"><a href="<?php echo esc_url( home_url( '/' ) ); ?>"><img src="<?php header_image(); ?>"height="<?php echo get_custom_header()->height; ?>"width="<?php echo get_custom_header()->width; ?>"alt="fortuneshop9999"/></a>
<!--Google 翻译器--><div id="google_translate_element">
<script type="text/javascript">函数 googleTranslateElementInit() {new google.translate.TranslateElement({ pageLanguage: 'nl', layout: google.translate.TranslateElement.InlineLayout.SIMPLE }, 'google_translate_element');}<script type="text/javascript" src="//translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"></script><!--结束--><div id="导航"><div><ul><?php wp_nav_menu( array( 'theme_location' => 'main-menu', 'container' => '', 'menu_class' => 'mainMenu' ) );?>
<div id="子导航"><ul><li class="menu-facebook"><a href="https://www.facebook.com" target="_blank">Facebook</a><li class="menu-twitter"><a href="http://www.twitter.com" target="_blank">Twitter</a><li class="menu-email"><a href="mailto:fortuneshop9999@gmail.com" target="_blank">电子邮件</a><li class="menu-pinterest"><a href="http://www.pinterest.com" target="_blank">Pinterest</a><form class="search" method="get" id="searchform" action="<?php bloginfo('home'); ?>/"><input type="text" value="<?php echo wp_specialchars($s, 1); ?>"name="s" id="s" placeholder="在此处搜索"/><input type="submit" id="submit" value=""/></表单>
style.css 代码是:
/*主题名称:Yogi7主题 URI:http://www.myotcworld.com/website-package.aspx添加一名作者作者 URI:http://www.myotcworld.com/website-package.aspx模板:yogi7版本:1.0.0*/body.custom-background {背景附件:滚动;背景: url("图片/无缝石背景.jpg");/*背景:#FDE6E0;*/背景位置:左上角;背景重复:重复;}身体 {背景:无重复滚动 0 0 #FFFFFF;颜色:#4A4A4A;font-family: "Times New Roman",Times,serif;字体大小:14px;边距:0 自动 30px;填充:0;}#header {宽度:960px;高度:285px;背景: url("Images/header.png") 不重复;}....
解决方案
我从主题的 styles.css 文件顶部删除了 Template: yogi7.这解决了问题.
这就是 styles.css 现在的样子.
/*主题名称:Yogi7主题 URI:http://www.myotcworld.com/website-package.aspx添加一名作者作者 URI:http://www.myotcworld.com/website-package.aspx版本:1.0.0*/body.custom-background {背景附件:滚动;背景: url("图片/无缝石背景.jpg");/*背景:#FDE6E0;*/背景位置:左上角;背景重复:重复;}身体 {背景:无重复滚动 0 0 #FFFFFF;颜色:#4A4A4A;font-family: "Times New Roman",Times,serif;字体大小:14px;边距:0 自动 30px;填充:0;}......
希望这对其他人有帮助.
In my WordPress Website's Themes Area I am getting strange message - "ERROR: The theme defines itself as its parent theme. Please check the Template header."
I Cannot Figure out what is Wrong. Please help me.
The header.php files code is given below:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title><?php wp_title( '|', true, 'right' ); ?></title>
<?php wp_head(); ?>
<link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>"/>
<link rel="icon" type="image/png" href="<?php bloginfo('stylesheet_directory'); ?>/Images/favicon.gif" />
<link rel="stylesheet" href="<?php bloginfo('stylesheet_directory'); ?>/Font/font-awesome-4.0.3/css/font-awesome.min.css">
</head>
<body class="custom-background">
<div id="wrap">
<div id="header">
<a href="<?php echo esc_url( home_url( '/' ) ); ?>">
<img src="<?php header_image(); ?>" height="<?php echo get_custom_header()->height; ?>" width="<?php echo get_custom_header()->width; ?>" alt="fortuneshop9999" />
</a>
</div>
<!--Google Translator-->
<div id="google_translate_element">
</div>
<script type="text/javascript">
function googleTranslateElementInit() {
new google.translate.TranslateElement({ pageLanguage: 'nl', layout: google.translate.TranslateElement.InlineLayout.SIMPLE }, 'google_translate_element');
}
</script>
<script type="text/javascript" src="//translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"></script>
<!--End-->
<div id="nav">
<div>
<ul>
<?php wp_nav_menu( array( 'theme_location' => 'main-menu', 'container' => '', 'menu_class' => 'mainMenu' ) );?>
</ul>
</div>
</div>
<div id="subnav">
<ul>
<li class="menu-facebook">
<a href="https://www.facebook.com" target="_blank">Facebook</a>
</li>
<li class="menu-twitter">
<a href="http://www.twitter.com" target="_blank">Twitter</a>
</li>
<li class="menu-email">
<a href="mailto:fortuneshop9999@gmail.com" target="_blank">Email</a>
</li>
<li class="menu-pinterest">
<a href="http://www.pinterest.com" target="_blank">Pinterest</a>
</li>
</ul>
<form class="search" method="get" id="searchform" action="<?php bloginfo('home'); ?>/">
<input type="text" value="<?php echo wp_specialchars($s, 1); ?>" name="s" id="s" placeholder="Search here"/>
<input type="submit" id="submit" value=""/>
</form>
</div>
The style.css code is:
/*
Theme Name: Yogi7
Theme URI: http://www.myotcworld.com/website-package.aspx
Author: Yogi
Author URI: http://www.myotcworld.com/website-package.aspx
Template: yogi7
Version: 1.0.0
*/
body.custom-background {
background-attachment: scroll;
background: url("Images/seamless-stone-background.jpg" ); /*background:#FDE6E0;*/
background-position: left top;
background-repeat: repeat;
}
body {
background: none repeat scroll 0 0 #FFFFFF;
color: #4A4A4A;
font-family: "Times New Roman",Times,serif;
font-size: 14px;
margin: 0 auto 30px;
padding: 0;
}
#header {
width: 960px;
height: 285px;
background: url("Images/header.png") no-repeat;
}
....
解决方案
I removed the Template: yogi7 from the top of my styles.css file of the theme. And this solved the problem.
This is how the styles.css look now.
/*
Theme Name: Yogi7
Theme URI: http://www.myotcworld.com/website-package.aspx
Author: Yogi
Author URI: http://www.myotcworld.com/website-package.aspx
Version: 1.0.0
*/
body.custom-background {
background-attachment: scroll;
background: url("Images/seamless-stone-background.jpg" ); /*background:#FDE6E0;*/
background-position: left top;
background-repeat: repeat;
}
body {
background: none repeat scroll 0 0 #FFFFFF;
color: #4A4A4A;
font-family: "Times New Roman",Times,serif;
font-size: 14px;
margin: 0 auto 30px;
padding: 0;
}
......
Hope this helps others.
这篇关于WordPress 主题“错误:主题将自身定义为其父主题.请检查模板标题."的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!