2015-12-03 50 views
0

这两个帖子都是从Wordpress中的同一个模板(single-post.php)生成的,但是第一个帖子是在#content-area div(不是我们想要的),而在第二个,页脚进来之间用#内容底部DIV的#内容股利后(这是我们想要的):PHP/HTML div没有关闭

http://restartcomputer.com/group-seminars-are-back-at-restart/

http://restartcomputer.com/events/icloud-seminar-10/

这里是源代码模板,单post.php:

<?php get_header(); ?> 

<div id="content-top" class="top-alt"></div> 

<div id="content" class="clearfix content-alt"> 

    <div id="content-area"> 

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

     <?php 
      $category = get_the_category(); 
      $catParent = get_cat_name ($category[0]->category_parent); 

      if ($catParent == 'Products') : 
     ?> 

      <div class="products-breadcrumbs"> 
       <?php 
        echo $catParent . '&nbsp;&nbsp;&#8594;&nbsp;'; 

        echo '<a href="' . get_category_link($category[0]->cat_ID) . '">' . $category[0]->cat_name . '</a>&nbsp;&nbsp;&#8594;&nbsp;&nbsp;'; 

        the_title(); 
       ?> 
      </div> 

     <?php endif; ?> 

     <?php 
      if (get_option('professional_integration_single_top') <> '' && get_option('professional_integrate_singletop_enable') == 'on') { 
       echo(get_option('professional_integration_single_top')); 
      } 
     ?> 

     <div class="entry clearfix post single-product-content"> 

      <h1 class="title"><?php the_title(); ?></h1>                

      <?php if (get_option('professional_thumbnails') == 'on') : ?> 

       <?php $thumb = ''; 
       $width = 200; 
       $height = 200; 
       $classtext = ''; 
       $titletext = get_the_title(); 
       $thumbnail = get_thumbnail($width,$height,$classtext,$titletext,$titletext); 
       $thumb = $thumbnail["thumb"]; ?> 

       <?php if($thumb <> '') : ?> 

        <div class="thumb alignleft"> 

         <?php print_thumbnail($thumb, $thumbnail["use_timthumb"], $titletext, $width, $height, $classtext); ?> 

         <span class="overlay"></span> 

        </div> <!-- end .thumb --> 

       <?php endif; ?> 

      <?php endif; ?> 

      <?php the_content(); ?> 

      <?php wp_link_pages(array('before' => '<p><strong>'.esc_html__('Pages','Professional').':</strong> ', 'after' => '</p>', 'next_or_number' => 'number')); ?> 

     </div> <!-- end .entry --> 


     <?php 
      if (get_option('professional_integration_single_bottom') <> '' && get_option('professional_integrate_singlebottom_enable') == 'on') { 
       echo(get_option('professional_integration_single_bottom')); 
      } 
     ?> 


     <?php if (get_option('professional_468_enable') == 'on') : 

       if(get_option('professional_468_adsense') <> '') : 
        echo(get_option('professional_468_adsense')); 

       else : 
      ?> 

       <a href="<?php echo(get_option('professional_468_url')); ?>"><img src="<?php echo(get_option('professional_468_image')); ?>" alt="468 ad" class="foursixeight" /></a> 

      <?php endif; ?> 

     <?php endif; ?> 



     <?php endwhile; endif; ?> 

    </div> <!-- end #content-area --> 



    <?php get_sidebar(); ?> 



</div> <!-- end #content --> 

<div id="content-bottom" class="bottom-alt"></div> 



<?php get_footer(); ?> 
+1

收盘'div's没有将在这里打球被封装在一个'的if/else的一个因素'块,所以这是很难排除故障从这一端。我会从[验证页面]开始(https://validator.w3.org/check?uri=http%3A%2F%2Frestartcomputer.com%2Fgroup-seminars-are-back-at-restart%2F&charset=%28detect +自动%29&doctype =内联&组= 0),但它可能没有关系。 – camelCase

回答

1

重启标志的HTML代码被打破,IMG和风格标签没有被关闭:

<p> 
    <img style="width: 130px;" src="http://restartcomputer.com/wp-content/uploads/2013/03/reStart-logo.png" style="width: 
</p>