@wtheel
9 years, 2 months ago
I hadn’t seen that. Very helpful. Thank you.
For others:
$var = $bp->groups->current_group->slug;
I just did, but it did not work. I looked at the function, saw $groups_template, and added the following inside and outside of the loop: var_dump($groups_template);
var_dump($groups_template);
Here’s the code from buddypress.php:
<? /* Template Name: BuddyPress */ get_header(); $plp_user_check = plp_user_check($current_user); var_dump($groups_template); echo "<br>Course Path: " . bp_get_group_slug(); include("forums-header.php"); ?> <? if( have_posts() ): ?> <? while( have_posts() ): the_post(); var_dump($groups_template); echo "<br>Course Path: " . bp_get_group_slug(); the_content(); endwhile; ?> <? else: ?> <div id="post-404" class="noposts"> <p><? _e('None found.','example'); ?></p> </div><!-- /#post-404 --> <? endif; wp_reset_query(); ?> </div><!-- /#bodyContainer <? get_footer(); ?>
The first var dump just returned “NULL”. The second one returned:
object(stdClass)#644 (1) { ["group"]=> NULL }