Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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(); ?>
    </div>

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

</div>

<?php endwhile; ?>
share|improve this 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
1  
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
1  
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 Feb 20 '12 at 15:05
show 2 more comments

1 Answer

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

Try:

'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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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