php - WordPress 主题 "ERROR: The theme defines itself as its parent theme. Please check the Template header."

标签 php wordpress

在我的 WordPress 网站的主题区域中,我收到一条奇怪的消息 - “错误:主题将自己定义为其父主题。请检查模板标题。” enter image description here 我无法弄清楚什么是错的。请帮我。

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">
<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>

style.css 代码是:

    /*
 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;
}
....

最佳答案

我从主题的 styles.css 文件顶部删除了 Template: yogi7。这解决了问题。

这就是 styles.css 现在的样子。

/*
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;
}
......

希望这对其他人有帮助。

关于php - WordPress 主题 "ERROR: The theme defines itself as its parent theme. Please check the Template header.",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48034914/

相关文章:

html - 找不到风格的来源

php - 以最有效的方式将不常见的日期格式转换为时间戳?

php - 代码检查 - 验证具有可选返回值的整数的函数

php - 试图加入 3 个 mysql 表,但我没有得到预期的结果。什么是错误?

wordpress - 如何做进度条动画?

php - 我应该放置 wp_reset_postdata();结束后;或结尾; ?

php - 为什么Laravel返回数组不能使用empty()但可以使用count()

php - 使用 mysqli 将印地语数据插入数据库

phpmyadmin 删除 [somemark]text[/somemark] 之间的文本

Python MySQL 长查询插入或更新