<div role="tabpanel" class="tab-pane" id="scholarship"> <?php $author = bp_displayed_user_id(); $rows = $wpdb->get_results($wpdb->prepare("\n SELECT post_id\n FROM wp_postmeta\n WHERE\n \t\t(meta_key = %s\n \t\tAND meta_value = %s)\n \tOR\n \t\t(meta_key LIKE %s \n \t\tAND meta_value = %s\n \t\t)\n ", 'scholarship_author_member', $author, 'scholarship_secondary_authors_%_scholarship_author_member', $author)); $ids = array(); foreach ($rows as $row) { $ids[] = $row->post_id; } if (!empty($ids)) { $args = array('post__in' => $ids, 'meta_key' => 'scholarship_date', 'orderby' => 'meta_value'); $author_query = new WP_Query($args); if ($author_query->have_posts()) { while ($author_query->have_posts()) { $author_query->the_post(); $child_category = Scholarship::get_child_category(get_the_ID()); $class_name = nameToClassName("Scholarship", $child_category); ?> <div class="post"> <div class="post-meta"> <?php $class_name::show('feed'); ?> </div> </div> <?php } } wp_reset_query(); } ?>