</div><!-- .entry-content --> <?php } else { ?> <div class="entry-summary"> <?php the_excerpt(); ?> </div><!-- .entry-summary --> <?php } ?> <?php if (ccgn_is_single_post()) { // if ( function_exists('bp_share_favorite_post_button') ) { // bp_share_favorite_post_button( $post->ID ); // } if (function_exists('cc_add_comment_button')) { cc_add_comment_button(get_the_ID()); } if (function_exists('love_it_button')) { love_it_button(); } if (function_exists('bp_share_post_button')) { bp_share_post_button(); } } ?>
/** * Get the appropriate query for various screens * * @return boolean */ function ccgn_get_query($group_id = null, $status = null) { // For single post, get the post by the slug if (ccgn_is_single_post()) { $query = array('name' => bp_action_variable(0), 'post_type' => 'group_story'); } else { $group_id = !$group_id ? bp_get_current_group_id() : $group_id; // Not a single post, this is the list of narratives for a group. // TODO: Finish pagination $paged = get_query_var('paged') ? get_query_var('paged') : 1; // $query= "related_groups=".$cats_list; $query = array('post_type' => 'group_story', 'tax_query' => array(array('taxonomy' => 'ccgn_related_groups', 'field' => 'id', 'terms' => ccgn_get_group_term_id($group_id), 'include_children' => false))); } // If the status is specified, respect it, otherwise use the user's abilities to determine. if ($status == 'draft') { $query['post_status'] = array('publish', 'draft'); } elseif ($status == 'publish') { $query['post_status'] = array('publish'); } else { // Get draft posts for those who can edit, otherwise only show published stories $query['post_status'] = ccgn_current_user_can_post() ? array('publish', 'draft') : array('publish'); } return apply_filters("ccgn_get_query", $query); }