我的css、页脚和页眉没有显示!

时间:2013-02-26 作者:Eus Maayen

当我在WordPress上的管理员中激活我的主题时,我的CSS、页眉和页脚都不会显示。我真的不知道问题出在哪里,因为我遵循了教程的所有步骤。

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" <?php language_attributes(); ?>>
<head profile="http://gmpg.org/xfn/11">
<meta http-equiv="Content-Type" content="<?php bloginfo(\'html_type\'); ?>; charset=<?php bloginfo(\'charset\'); ?>" />
<title>
<?php wp_title(\'&laquo;\', true, \'right\'); ?>
<?php bloginfo(\'name\'); ?>
</title>
<!-- Main WordPress Stylesheet -->
<link rel="stylesheet" href="<?php bloginfo(\'stylesheet_url\'); ?>" type="text/css" media="screen" />
<!-- WYSIWYG CSS -->
<link rel="stylesheet" href="<?php bloginfo(\'stylesheet_directory\'); ?>/css/wysiwyg.css" type="text/css" media="screen" />
<link rel="pingback" href="<?php bloginfo(\'pingback_url\'); ?>" />



<link href="<? bloginfo(\'stylesheet_directory\'); ?>/css/index.css" type="text/css" rel="stylesheet" />

<?php  wp_head(); ?>
</head>
<body>
<div class="topBar"></div>

<!-- Begin container -->
<div id="container">
<!-- Begin contact -->
<div class="contactInfo">
  <ul>
    <li>1234 Main Street NE, Suite 201</li>
    <li>Grand Rapids, MI 49503 Main 616 555 5555</li>
  </ul>
</div>
<!--/ End contact --> 

<!-- Begin navigation container -->
<div class="navigationContainer"> 

  <!-- Begin logo -->
  <div class="logo"> <a href="index.html"><img src="images/logo.jpg" alt="Megan Sullivan" /></a> </div>
  <!--/ End logo --> 

  <!-- Begin navigation -->
  <div class="navigation">
    <ul>
      <li class="active"><a href="index.html">Home</a></li>
      <li><a href="portfolio.html">Portfolio</a></li>
      <li><a href="about.html">About</a></li>
      <li><a href="contact.html">Contact</a></li>
    </ul>
  </div>
  <!--/ End navigation --> 

</div>
<!--/ End navigation container --> 

<!-- Begin grey separator -->
<div class="greySeparator"></div>
<!--/ End grey separator -->

footer.php

 <!-- Begin footer -->
    <div class="footer">
        Copyright &copy; 2009, Megan Sullivan. All Rights Reserved.
    </div>
    <!--/ End footer -->
</div>
<!--/ End container -->
<?php wp_footer(); ?>
</body>
</html>

1 个回复
SO网友:Rahul Patil

这就是你的索引。php和其他面向公众的页面应为。。不要忘记添加get\\u header()和get\\u footer()

<?php get_header(); ?>

    <!-- Row for main content area -->
    <div id="content">

        <div>
            <!--  Main Content Loop HERE, or just use while have posts and get the content;..-->
            <?php get_template_part(\'loop\', \'index\'); ?>
        </div>

    </div><!-- End Content row -->

    <?php get_sidebar(); ?>
在此处了解更多信息:http://codex.wordpress.org/Function_Reference/get_headerhttp://codex.wordpress.org/Function_Reference/get_footer

结束

相关推荐

如何使用WordPress函数删除标题中的css文件?

我想删除头中加载的CSS,这是显示的代码:<link rel=\'stylesheet\' id=\'my-css\' href=\'http://test.tld/wp-content/themes/mytheme/my.css?ver=3.5\' type=\'text/css\' media=\'all\' /> 我尝试使用这些功能,但没有成功:wp_dequeue_style(\'my-css\'); wp_deregister_style(\'my-css\');