dsfsad089111 2016-05-25 20:41
浏览 96

PHP解析错误:语法错误,第26行/wp-content/themes/awaken/page.php中的意外'endwhile'(T_ENDWHILE)[重复]

This question already has an answer here:

i have error log

PHP Parse error: syntax error, unexpected 'endwhile' (T_ENDWHILE) in /wp-content/themes/awaken/page.php on line 26

my page.php

get_header(); ?>
<div class="row">
<?php is_rtl() ? $rtl = 'awaken-rtl' : $rtl = ''; ?>
<div class="col-xs-12 col-sm-12 col-md-8 <?php echo $rtl ?>">
    <div id="primary" class="content-area">
        <main id="main" class="site-main" role="main">
            <?php while ( have_posts() ) : the_post(); ?>
                <?php get_template_part( 'content', 'page' ); ?>
                <?php if ( get_theme_mod( 'display_page_comments', 1 ) ) { // If comments are open or we have at least one comment, load up the comment template if ( comments_open() || '0' != get_comments_number() ) : comments_template(); endif; } ?>
            <?php endwhile; // end of the loop. ?>
        </main><!-- #main -->
    </div><!-- #primary -->
</div><!-- .bootstrap cols -->
<div class="col-xs-12 col-sm-6 col-md-4">
    <?php get_sidebar(); ?>
</div><!-- .bootstrap cols -->
</div><!-- .row -->
<?php get_footer(); ?>

Please help! i have a 503 error, and think it's a problem

</div>
  • 写回答

2条回答 默认 最新

  • drcvvkx914772 2016-05-25 20:45
    关注

    Do you see it? I do. You've commented out code and incidentally took the closing bracket to if( get_theme_mod with it. This is a simple syntax error.

    <?php if ( get_theme_mod( 'display_page_comments', 1 ) ) { // If comments are open or we have at least one comment, load up the comment template if ( comments_open() || '0' != get_comments_number() ) : comments_template(); endif; } ?>
    

    Needs to be changed to

     <?php if ( get_theme_mod( 'display_page_comments', 1 ) ) { 
         // If comments are open or we have at least one comment, load up the comment template 
         if ( comments_open() || '0' != get_comments_number() ) : 
             comments_template();        
         endif; 
     } ?>
    

    If you don't want the comments template, then just comment out //comments_template();

    The reason for this is that the inline commenting you've added will comment out the entire line it doesn't pick and choose which parts it should comment out and which parts it should let the interpreter process.

    评论

报告相同问题?

悬赏问题

  • ¥15 HFSS 中的 H 场图与 MATLAB 中绘制的 B1 场 部分对应不上
  • ¥15 如何在scanpy上做差异基因和通路富集?
  • ¥20 关于#硬件工程#的问题,请各位专家解答!
  • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
  • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
  • ¥30 截图中的mathematics程序转换成matlab
  • ¥15 动力学代码报错,维度不匹配
  • ¥15 Power query添加列问题
  • ¥50 Kubernetes&Fission&Eleasticsearch
  • ¥15 報錯:Person is not mapped,如何解決?