A common aesthetic choice for news sites that allow readers to leave comments on articles is for the commenter's name to be shown below the comment they left rather than above it. This facilitates discussion flow and encourages people to read the comments before looking at the names of the people who wrote them.
This is not the default in Newspack and the theme currently makes it difficult to choose this alternative configuration for a comments area. The order cannot easily be changed because class-newspack-walker-comment.php (where the relevant code lives) is being called with a require() statement in functions.php:
While many aspects of Newspack can be successfully modified with a child theme, it's not possible to override a class that's being called with a require() or include() statement. It would be helpful to have a toggle in the theme that allows the positioning of comment meta to be changed from above to below. If this existed, we wouldn't need to modify class-newspack-walker-comment.php to move the div comment-content above the comment-meta div:
This new setting could be added to the Comments Settings, which currently has three settings:
Collapse Comments (When using WordPress's default comments, checking this option will collapse the comments section when there is more than one comment, and display a button to expand)
Display comment policy (Allows you to add an optional comment policy above the comment form when using WordPress's default comments)
Comment policy text
Some demo code is enclosed, which I've tested on a site running the latest Newspack theme released on 05/28/2028. This just shows the implementation of the idea - I put my function in functions.php so it would be easy for me to find while I was coding. I'm sure this could be more elegant.
Add to functions.php:
function newspack_customize_add_comment_layout_control( $wp_customize ) {
// Add the new control to the existing section
$wp_customize->add_setting( 'newspack_comment_order', array(
'default' => 'meta_above_content',
'sanitize_callback' => 'sanitize_text_field',
) );
$wp_customize->add_control( 'newspack_comment_order', array(
'label' => __( 'Comment Layout', 'newspack' ),
'section' => 'comments_options', // Add to the existing section
'settings' => 'newspack_comment_order',
'type' => 'radio',
'choices' => array(
'meta_above_content' => __( 'Meta above content', 'newspack' ),
'content_above_meta' => __( 'Content above meta', 'newspack' ),
),
) );
}
add_action( 'customize_register', 'newspack_customize_add_comment_layout_control' );
A common aesthetic choice for news sites that allow readers to leave comments on articles is for the commenter's name to be shown below the comment they left rather than above it. This facilitates discussion flow and encourages people to read the comments before looking at the names of the people who wrote them.
This is not the default in Newspack and the theme currently makes it difficult to choose this alternative configuration for a comments area. The order cannot easily be changed because class-newspack-walker-comment.php (where the relevant code lives) is being called with a require() statement in functions.php:
While many aspects of Newspack can be successfully modified with a child theme, it's not possible to override a class that's being called with a require() or include() statement. It would be helpful to have a toggle in the theme that allows the positioning of comment meta to be changed from above to below. If this existed, we wouldn't need to modify class-newspack-walker-comment.php to move the div comment-content above the comment-meta div:
This new setting could be added to the Comments Settings, which currently has three settings:
Some demo code is enclosed, which I've tested on a site running the latest Newspack theme released on 05/28/2028. This just shows the implementation of the idea - I put my function in functions.php so it would be easy for me to find while I was coding. I'm sure this could be more elegant.
Add to functions.php:
Replace class-newspack-walker-comment.php with: