0

当我添加时,我正在使用 wordpress

<?php bsg_head(); ?>

到页眉页面上的所有内容都消失了。样式表中的格式仍然会应用,尽管它会更改背景颜色。谁能帮我弄清楚为什么?

单.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>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title><?php bloginfo('name'); ?> | <?php bloginfo('title'); ?></title>
<link href="<?php bloginfo('stylesheet_url'); ?>" rel="stylesheet" type="text/css" />
<?php bsg_head(); ?>
</head>

<body>

<div class="container_12" id="singlepost">
    <div class="grid_12">

      <?php if (have_posts()) : ?>

      <?php while (have_posts()) : the_post(); ?>

      <h2><?php the_title(); ?></h2>
                <?php the_content(); ?>


      <?php endwhile; ?>


      <?php else : ?>


      <?php endif; ?>

    </div>
    <div class="clear"></div>
</div>




</body>
</html>

样式.css

/*
Theme Name:
Theme URI: http://www..co.uk
Description: 
Version: 2
Author: Alex Sadler
Author URI: http://www..co.uk
*/

@charset "UTF-8";
/* CSS Document */

@import url("css/grid.css");
@import url("css/fonts/fonts.css");
@import url("css/coda-slider.css");
@import url("css/jquery.fancybox.css");

body,td,th {
    font-family: Verdana, Arial, Helvetica, sans-serif;
    font-size: 10px;
    color: #FFFFFF;
}
body {
    background-color: #3D341A;
    background-repeat: repeat-x;
    margin: 0px;
    padding: 0px;
}
a:link {
    color: #FFFFFF;
    font-weight: bold;
    text-decoration: none;
}
a:visited {
    color: #FFFFFF;
    text-decoration: none;
}
a:hover {
    color: #CCCCCC;
    text-decoration: underline;
}
a:active {
    color: #FFFFFF;
    text-decoration: none;
}
h1,h2,h3,h4,h5,h6 {
    font-family: nexa_boldregular, Arial, Helvetica, sans-serif;
    text-transform: uppercase;
    margin: 5px 0px 5px;
    padding: 0px;
}
h1 {
    font-size: 18px;
    color: #FFFFFF;
}
h2 {
    font-size: 12px;
    color: #FFFFFF;
}
h3 {
    font-size: 10px;
    color: #FFFFFF;
}
P {
    margin: 0px;
    padding: 0px;
}
IMG {
    border: 0px;
}
.center {
    text-align: center;
}
#contentwrapper {
    padding-bottom: 20px;
}
#header {
    padding-top: 20px;
    position: fixed;
    width: 100%;
    padding-bottom: 20px;
    z-index: 99;
}
#title h1 {
    font-size: 24px;
}
#info {
    text-align: right;
    text-transform: uppercase;
    font: normal 12px nexa_lightregular, Arial, Helvetica, sans-serif;
}
#info .headerphone {
    font-family: nexa_boldregular, Arial, Helvetica, sans-serif;
}
#slogan {
    padding-top: 350px;
    text-shadow: 0px 0px 2px #000;
}
#slogan h1 {
    margin: -30px 0px 0px;
    padding: 0px;
    font: small-caps 120px nexa_boldregular, Arial, Helvetica, sans-serif;
}
#slogan h2 {
    margin: 0px;
    padding: 0px;
    font: small-caps 60px nexa_boldregular, Arial, Helvetica, sans-serif;
}
.block {
    height: 170px;
    width: 260px;
    padding: 20px;
    background: #525055 no-repeat center center;
    float: left;
}
.portfolioblock {
    height: 210px;
    width: 300px;
    background: #525055 no-repeat center center;
    float: left;
    overflow: hidden;
}
.portfolioblock .rollover {
    height: 170px;
    width: 260px;
    padding: 20px;
    background: url(img/rolloverbg.png); 
    margin-top: 210px; 
    -webkit-transition: all 0.2s linear; 
    -moz-transition: all 0.2s linear; 
    -o-transition: all 0.2s linear;
}
.portfolioblock:hover .rollover {
    float: left; 
    margin-top: 0px;
    -webkit-transition: all 0.2s linear; 
    -moz-transition: all 0.2s linear; 
    -o-transition: all 0.2s linear;
}
.portfolioblock img {
    margin-bottom: 20px;
}
.text h1 {
    margin-left: 55px;
    margin-top: 25px;
}
#socialmedia {
    text-align: right;  
}
#singlepost {
    padding-top: 20px;
    padding-bottom: 20px;   
}
#blog a {
    font-weight: normal;
}
4

2 回答 2

1

据我所知,您需要<?php wp_head(); ?>. 不要忘记<?php wp_footer(); ?>在您的页脚中,在您的</body>标签之前,这通常用于与 javascript 库相呼应的插件。

于 2012-08-13T13:44:06.963 回答
0

在php中启用错误报告,以便您可以看到确切的错误

添加以下代码

<? error_reporting(E_ALL); ?>

如需更多 PHP 更新,请访问http://www.phpsyntax.blogspot.in/

于 2012-08-13T13:45:36.993 回答