Archived topic
Comments stylesheet is not loading when post comments are disabled
1 reply · Started by James on July 20, 2021
comments.min.css is not being loaded on the front end of the site when there are existing comments but new comments are disabled.
If I disable the option for "allow comments" on a specific post then that post will still show the existing comments that were made when comments were open, but the stylesheet is not loaded, making the display look very strange.
Hi James,
This one is up for fixing on GeneratePress 3.1.
But if you wish to apply a workaround fix for this now you can add this PHP snippet.
add_action( 'wp_enqueue_scripts', function() {
if ( is_singular() && ( comments_open() || '0' != get_comments_number() ) ) {
wp_enqueue_style( 'generate-comments', get_template_directory_uri() . "/assets/css/components/comments.min.css", array(), GENERATE_VERSION, 'all' );
}
} );