WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've created a new home template for my buddypress groups called front.php. With the code below, I've attempted to display the content of a wp page whose name corresponds to the group name. The loop I have below is in fact displaying pages. But instead of displaying the content of only the corresponding page, it is displaying the content of ALL pages with names that correspond to bp groups. What am I missing?

<?php $args = array( 'post_type' => 'page', /*'pagename' => bp_the_group()*/ ); 
        query_posts( $args ); ?>

<?php while ( have_posts() ) : the_post(); ?>

<div class="post">

<h1><?php the_title(); ?></h1>

    <div class="entry">
    <?php the_content(); ?>

<?php edit_post_link( __( '{ Edit }', 'woothemes' ), '<span class="small">', '</span>' ); ?>


<?php endwhile; ?>
share|improve this question

closed as off-topic by Johannes Pille, ialocin, Wyck, Pat J, toscho Aug 16 '14 at 0:51

This question appears to be off-topic. The users who voted to close gave this specific reason:

If this question can be reworded to fit the rules in the help center, please edit the question.

Doesn't have WOO Themes a support forum for stuff like this? – kaiser Feb 20 '12 at 14:15
While I'm on the topic, I'd also like to make the edit_post_link visible only for group managers and admins. Haven't been able to locate a bp_is_group_manager tag. – Matt Edminster Feb 20 '12 at 14:26
Hey Kaiser ... yeah, Woo has great customer service. But this question is a bit outside of their range. I'm using their theme as my base, but I've done all the bp customization myself. This question is something I've seen referenced in other places with no solid answers. Just thought I'd pitch it here for the wide community to take a shot at. – Matt Edminster Feb 20 '12 at 14:41
Ok, thought this is a dedicated BP theme. – kaiser Feb 20 '12 at 15:05
As far as the admin and managers edit link goes, that should be a separate question. The answer, though, is to use the bp_is_item_mod() and bp_is_item_admin() functions. – Joseph Leedy Feb 20 '12 at 15:05

Your problem is bp_the_group(). This function doesn't return a value - it's akin to WP_Query's the_post().


'pagename => bp_get_current_group_slug()
share|improve this answer
Thanks Boone! Looks like I'll be defaulting to your Docs plugin for now. I'd still like navigation options that look like the plugin pages on the buddypress extensions site. But I suppose that will be a ways off still. – Matt Edminster Apr 12 '12 at 7:12

Not the answer you're looking for? Browse other questions tagged or ask your own question.