解析错误:语法错误,第18行的wp-content \ themes \ wppro \ index.php中的文件意外结束

时间:2013-12-26 18:11:26

标签: php wordpress syntax-error wamp

在此处发布问题之前,我用Google搜索了几个小时,并建议我在php.ini中打开short_open_tagasp_tags。我正在使用WAMP服务器并在配置php.ini后重新启动它。但仍然显示出错误。我可以帮我找到错过的东西吗?这是我在index.php中的内容。

    <?php get_header(); ?>

    <div class="container">
        <?php get_sidebar(); ?>
          <div class="span9">
            <section id="download-bootstrap">
              <div class="page-header">
        <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
          <div class="page-header">
            <h1><a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></h1>
          </div>
            <?php the_excerpt(); ?>
        <?php endwhile; ?>
            </section>
          </div>
    </div>

    <?php get_footer(); ?>

2 个答案:

答案 0 :(得分:0)

您没有关闭if声明。

替换:

<?php endwhile; ?>

使用:

<?php
  endwhile;
  endif;
?>

答案 1 :(得分:0)

  Put this line after <?php the_excerpt(); ?>

  <?php endwhile; endif; ?>

  and also close container class div.