diff --git a/newspack-theme/classes/class-newspack-walker-comment.php b/newspack-theme/classes/class-newspack-walker-comment.php index 67d563c40..56beb16ee 100755 --- a/newspack-theme/classes/class-newspack-walker-comment.php +++ b/newspack-theme/classes/class-newspack-walker-comment.php @@ -25,72 +25,107 @@ protected function html5_comment( $comment, $depth, $args ) { $tag = ( 'div' === $args['style'] ) ? 'div' : 'li'; - ?> - < id="comment-" has_children ? 'parent' : '', $comment ); ?>> -
- + comment_approved ) : ?> +

+ + + $_meta_level ) { + ob_end_clean(); + } + } -
- -
+ $comment_content = ''; + $_content_level = ob_get_level(); + try { + ob_start(); + ?> +
+ +
+ $_content_level ) { + ob_end_clean(); + } + } + + $comment_meta_position = get_theme_mod( 'comment_meta_position', 'above' ); + ?> + < id="comment-" has_children ? 'parent' : '', $comment ); ?>> +
+
esc_html__( 'Menu', 'newspack-theme' ), - 'sanitize_callback' => 'sanitize_text_field', + 'sanitize_callback' => 'newspack_sanitize_radio', ) ); $wp_customize->add_control( @@ -1254,6 +1254,27 @@ function newspack_customize_register( $wp_customize ) { ) ); + // Add option to control comment meta position. + $wp_customize->add_setting( + 'comment_meta_position', + array( + 'default' => 'above', + 'sanitize_callback' => 'newspack_sanitize_radio', + ) + ); + $wp_customize->add_control( + 'comment_meta_position', + array( + 'type' => 'radio', + 'label' => esc_html__( 'Comment meta position', 'newspack-theme' ), + 'section' => 'comments_options', + 'choices' => array( + 'above' => esc_html__( 'Above comment content', 'newspack-theme' ), + 'below' => esc_html__( 'Below comment content', 'newspack-theme' ), + ), + ) + ); + /** * Footer settings */