【问题标题】:Parse error: syntax error, unexpected end of file in wp-content\themes\wppro\index.php on line 18解析错误:语法错误,第 18 行 wp-content\themes\wppro\index.php 中的文件意外结束
【发布时间】:2013-12-26 18:11:26
【问题描述】:

在这里发布问题之前,我用谷歌搜索了几个小时,并按照建议在我的 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(); ?>

【问题讨论】:

    标签: php wordpress syntax-error wamp


    【解决方案1】:

    您没有关闭您的if 声明。

    替换:

    <?php endwhile; ?>
    

    与:

    <?php
      endwhile;
      endif;
    ?>
    

    【讨论】:

      【解决方案2】:
        Put this line after <?php the_excerpt(); ?>
      
        <?php endwhile; endif; ?>
      
        and also close container class div.
      

      【讨论】:

        猜你喜欢
        • 2014-04-13
        • 2013-12-16
        • 2013-02-03
        • 2013-07-12
        • 1970-01-01
        • 2016-01-25
        • 2018-01-02
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多