语法错误,第 288 行出现意外的“endif"(T_ENDIF) [英] syntax error, unexpected 'endif' (T_ENDIF) on line 288

查看:29
本文介绍了语法错误,第 288 行出现意外的“endif"(T_ENDIF)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在为我的 worpress 站点离线处理此代码错误.

<块引用>

解析错误:语法错误,第 288 行/homez.541/photoher/marie/wp-content/themes/hemingway/functions.php 中出现意外的endif"(T_ENDIF)

行代码错误第288行:<p class="comment-awaiting-moderation"><?php _e('Awaiting moderation', 'hemingway');?></p>

这是错误的完整代码:

 
  • id="comment-<?php comment_ID(); ?>"><?php __( 'Pingback:', '海明威');?><?php comment_author_link();?><?php edit_comment_link( __( '(Edit)', 'hemingway' ), '<span class="edit-link">', '</span>' );?>
  • <?php休息;默认 :全球 $post;?><li <?php comment_class();?>id="li-comment-<?php comment_ID(); ?>"><div id="comment-<?php comment_ID(); ?>"类=评论"><div class="comment-meta comment-author vcard"><?php echo get_avatar( $comment, 120 );?><div class="comment-meta-content"><?php printf('<cite class="fn">%1$s %2$s</cite>',get_comment_author_link(),( $comment->user_id === $post->post_author )?'<span class="post-author">' .__( '(文章作者)', '海明威' ) .'</span>':'');?><p><a href="<?php echo esc_url( get_comment_link( $comment->comment_ID ) ) ?>"><?php echo get_comment_date() .' 在 ' .get_comment_time() ?></a></p>

    <!--/comment-meta-content -->

    <!--/comment-meta --><div class="comment-content post-content"><?php if ( '0' == $comment->comment_approved ) : ?><p class="comment-awaiting-moderation"><?php _e('等待审核', '海明威');?></p><?php endif;?><?php comment_text();?><div class="comment-actions"><?php edit_comment_link( __( '编辑', '海明威' ), '', '' );?><?php comment_reply_link( array_merge( $args, array( 'reply_text' => __( 'Reply', 'hemingway' ), 'depth' => $depth, 'max_depth' => $args['max_depth'] ) ) );?><div class="clear"></div>

    <!--/comment-actions --></div><!--/comment-content --></div><!--/comment-## --><?php休息;结束开关;}万一;

    请帮帮我.

    解决方案

    你不应该有 } endif;.

    使用 if (...) {}if (...):/endif;,但不要同时使用.

    I've been working on this code error for my worpress site offline.

    Parse error: syntax error, unexpected 'endif' (T_ENDIF) in /homez.541/photoher/marie/wp-content/themes/hemingway/functions.php on line 288

    Line code error line 288: <p class="comment-awaiting-moderation"><?php _e( 'Awaiting moderation', 'hemingway' ); ?></p>

    Here is the whole code for the error:

        <li <?php comment_class(); ?> id="comment-<?php comment_ID(); ?>">
    
            <?php __( 'Pingback:', 'hemingway' ); ?> <?php comment_author_link(); ?> <?php edit_comment_link( __( '(Edit)', 'hemingway' ), '<span class="edit-link">', '</span>' ); ?>
    
        </li>
        <?php
                break;
            default :
            global $post;
        ?>
        <li <?php comment_class(); ?> id="li-comment-<?php comment_ID(); ?>">
    
            <div id="comment-<?php comment_ID(); ?>" class="comment">
    
                <div class="comment-meta comment-author vcard">
    
                    <?php echo get_avatar( $comment, 120 ); ?>
    
                    <div class="comment-meta-content">
    
                        <?php printf( '<cite class="fn">%1$s %2$s</cite>',
                            get_comment_author_link(),
                            ( $comment->user_id === $post->post_author ) ? '<span class="post-author"> ' . __( '(Post author)', 'hemingway' ) . '</span>' : ''
                        ); ?>
    
                        <p><a href="<?php echo esc_url( get_comment_link( $comment->comment_ID ) ) ?>"><?php echo get_comment_date() . ' at ' . get_comment_time() ?></a></p>
    
                    </div> <!-- /comment-meta-content -->
    
                </div> <!-- /comment-meta -->
    
                <div class="comment-content post-content">
    
                    <?php if ( '0' == $comment->comment_approved ) : ?>
    
                        <p class="comment-awaiting-moderation"><?php _e( 'Awaiting moderation', 'hemingway' ); ?></p>
    
                    <?php endif; ?>
    
                    <?php comment_text(); ?>
    
                    <div class="comment-actions">
    
                        <?php edit_comment_link( __( 'Edit', 'hemingway' ), '', '' ); ?>
    
                        <?php comment_reply_link( array_merge( $args, array( 'reply_text' => __( 'Reply', 'hemingway' ), 'depth' => $depth, 'max_depth' => $args['max_depth'] ) ) ); ?>
    
                        <div class="clear"></div>
    
                    </div> <!-- /comment-actions -->
    
                </div><!-- /comment-content -->
    
            </div><!-- /comment-## -->
        <?php
            break;
        endswitch;
    }
    endif;
    

    Please help me.

    解决方案

    You shouldn't have a } endif;.

    Use if (...) {} or if (...):/endif;, but don't use both.

    这篇关于语法错误,第 288 行出现意外的“endif"(T_ENDIF)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

    查看全文
    相关文章
    PHP最新文章
    热门教程
    热门工具
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆