简体   繁体   English

PHP / HTML div无法关闭

[英]PHP/HTML div not closing

Both of these posts are generated from the same template (single-post.php) in Wordpress, however on the first one, the footer is inside the #content-area div (not what we want), while in the second one, the footer comes after the #content div with a #content-bottom div in between (this is what we want): 这两个帖子都是从Wordpress中的同一模板(single-post.php)生成的,但是在第一个模板中,页脚位于#content-area div(不是我们想要的)内部,而在第二个模板中,页脚位于#content-area div中页脚位于#content div之后,中间是#content-bottom div(这是我们想要的):

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

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

Here is the source code for the template, single-post.php: 这是模板single-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(); ?>

The html code of Restart logo is broken, the img and style tags are not closed: 重新启动徽标的html代码已损坏,img和样式标签未关闭:

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM