Lego2012
12/13/2016 - 3:25 PM

Show comments list and form for entries on archives

Show comments list and form for entries on archives

<?php
//* Do NOT include the opening php tag shown above. Copy the code shown below.

add_action( 'pre_get_posts', 'prefix_archive_comments_query' );
function prefix_archive_comments_query( $query ) {
    if ( ! is_admin() && ! is_feed() && ! is_singular() ) {
        set_query_var( 'withcomments', true );
    }
    return $query;
}

add_action( 'genesis_after_entry', 'prefix_archive_comments' );
function prefix_archive_comments( $query ) {
    if ( ! is_singular() ) {
        comments_template( '', true );
    }
}