语法错误,第 288 行上的意外'endif' (T_ENDIF)



我一直在为我的worpress网站离线处理这个代码错误。

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

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

以下是错误的完整代码:

    <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;

请帮帮我。

您不应该有} endif;

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

相关内容

最新更新