| 1 |
<?php |
| 2 |
/** |
| 3 |
* This template contains the comments content in the footer for an article on /friends/. |
| 4 |
* |
| 5 |
* @version 1.0 |
| 6 |
* @package Friends |
| 7 |
*/ |
| 8 |
|
| 9 |
?><footer class="comments-content card-footer <?php echo is_single() ? 'open' : 'closed'; ?>"> |
| 10 |
<?php |
| 11 |
if ( is_single() ) { |
| 12 |
$_post_id = get_the_ID(); |
| 13 |
$_comments = apply_filters( |
| 14 |
'friends_get_comments', |
| 15 |
get_comments( |
| 16 |
array( |
| 17 |
'post_id' => $_post_id, |
| 18 |
'status' => 'approve', |
| 19 |
'order' => 'ASC', |
| 20 |
'orderby' => 'comment_date_gmt', |
| 21 |
) |
| 22 |
), |
| 23 |
$_post_id |
| 24 |
); |
| 25 |
|
| 26 |
if ( ! empty( $_comments ) ) { |
| 27 |
$template_loader = Friends\Friends::template_loader(); |
| 28 |
?> |
| 29 |
<h5><?php esc_html_e( 'Comments' ); /* phpcs:ignore WordPress.WP.I18n.MissingArgDomain */ ?></h5> |
| 30 |
<ol class="comment-list"> |
| 31 |
<?php |
| 32 |
remove_all_filters( 'comments_template' ); |
| 33 |
wp_list_comments( |
| 34 |
array( |
| 35 |
'style' => 'ol', |
| 36 |
'short_ping' => true, |
| 37 |
'avatar_size' => 24, |
| 38 |
), |
| 39 |
$_comments |
| 40 |
); |
| 41 |
?> |
| 42 |
</ol><!-- .comment-list --> |
| 43 |
<?php |
| 44 |
} |
| 45 |
do_action( 'friends_comments_form', $_post_id ); |
| 46 |
} |
| 47 |
?> |
| 48 |
</footer> |
| 49 |
|