【问题标题】:Content disappearing when bsg_head(); is added to the <head> tagbsg_head() 时内容消失;被添加到 <head> 标签
【发布时间】:2012-08-13 21:45:36
【问题描述】:

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

<?php bsg_head(); ?>

到页眉的所有内容都消失了。样式表中的格式仍然会应用,尽管它会更改背景颜色。谁能帮我找出原因?

single.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>

style.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;
}

【问题讨论】:

    标签: php html wordpress wordpress-theming


    【解决方案1】:

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

    【讨论】:

      【解决方案2】:

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

      添加以下代码

      <? error_reporting(E_ALL); ?>
      

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

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2012-12-27
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多