| @@ -43,11 +43,13 @@ | ||
| 43 | 43 | ] |
| 44 | 44 | ]; |
| 45 | 45 | } |
| 46 | 46 | |
| 47 | -$query = new WP_Query( $args ); | |
| 47 | +// User profile pages render the bbPress topics loop below, so skip this query there. | |
| 48 | +$is_user_page = forumax_is_user_profile_page(); | |
| 49 | +$query = $is_user_page ? null : new WP_Query( $args ); | |
| 48 | 50 | |
| 49 | -if ( $query->have_posts() && !in_array('bbp-user-page', get_body_class()) ) : | |
| 51 | +if ( ! $is_user_page && $query->have_posts() ) : | |
| 50 | 52 | echo '<div class="community-posts-wrapper bb-radius">'; |
| 51 | 53 | while ( $query->have_posts() ) : $query->the_post(); |
| 52 | 54 | global $post; |
| 53 | 55 | $parent_post_id = get_queried_object_id(); |
| @@ -130,9 +132,9 @@ | ||
| 130 | 132 | <?php endif; ?> |
| 131 | 133 | </div> |
| 132 | 134 | <?php |
| 133 | 135 | |
| 134 | -elseif ( in_array('bbp-user-page', get_body_class()) ): | |
| 136 | +elseif ( $is_user_page ): | |
| 135 | 137 | ?> |
| 136 | 138 | <div id="bbp-topic-<?php bbp_topic_id(); ?>" class="community-posts-wrapper bb-radius"> |
| 137 | 139 | <?php |
| 138 | 140 | while ( bbp_topics() ) : bbp_the_topic(); |