语法错误,意想不到的'endif'(T
我一直在为我的worpress网站离线处理此代码错误。
Parse error:syntax error,unexpected'endif'(T_ENDIF)in /homez.541/photoher/marie/wp-content/themes/hemingway/functions.php on line 288
行代码错误行288: <p class="comment-awaiting-moderation"><?php _e( 'Awaiting moderation', 'hemingway' ); ?></p>
<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;
,但不要同时使用两者。