What is it that you are trying to do?
Basically im trying to take the title of the page which matches my group slugs and get the info from the groups. trying to make the page completely dynamic. In the content of the whole thing the codes like this.
<?php if ( bp_has_groups( 'type=single-group&slug=' . the_title() ) ) : ?>
<dl class="featured_network_info">
<?php while ( bp_groups() ) : bp_the_group(); ?>
<!-- Example template tags you can use -->
<dt><a href="<?php bp_group_permalink() ?>"></a></dt>
<dd class="featured_title"><?php bp_group_name() ?></dd><?php bp_group_avatar_thumb() ?>
<dd class="featured_members">Members : <?php bp_group_total_members() ?></dd>
<dd> <?php bp_group_description_excerpt() ?></dd>
<?php endwhile; ?>
</dl>
<?php else: ?>
<div id="message" class="info">
<p>There are no groups to display.</p>
</div>
<?php endif; ?>
But I can’t get any output from anything.
If the template tag “the_title()” is the group title, it is simply not available yet when starting the loop.
Like Plrk,
What is it that you are trying to do?
Im not trying to use the group title, im trying to use the page title.
Basically if I’ve got a page called page1 I want to retrieve the group details for the group called page1. I’m trying to do it dynamically because I want to use the same template instead of making up 50 odd templates for this particular project.
I can get it to work if I pass in the slug as a string ie just
`<?php if ( bp_has_groups( ‘type=single-group&slug=page1’) ) : ?>
Chris
chrisknade, those two functions don’t really work together to give you anything that you could compare and get any real value out of.
I won’t quote anyone else, but I’m curious too..
Im not sure how you mean that, can you see the two replys i posted above? I couldn’t see them there until i logged in again? Im basically just trying to use the page title to get a group.
In the simpliest way I can put it.
If my page title is pagetitle
<?php if ( bp_has_groups( ‘type=single-group&slug=pagetitle’ ) ) : ?>
Im just trying to use the page title dynamically you see, because Im using this code in a template page. so gonna have page titles based on people names that have corresponding group slugs.
YAY MY POSTS HAVE FINALLY APPEARED.
Can anyone now help me lol ?
Chris
I still don’t quite get it, but I’ll assume that you’re trying to pull up group information that has the same Group Name as the Page Title?
If so, does that mean you’re creating a page for each group manually? Ugh, no fun… Alas, this is what I would do, within ‘the loop’…
$group_page_title = the_title('', '', false);
<?php if ( bp_has_groups( 'type=single-group&slug=' . $group_page_title ) ) : ?>
And then proceed? I haven’t tested it, so no promises…
(The call to the_title could also probably just reference a $post-> variable, but I don’t remember what the title is off the top of my head.)
Yep that worked, thanks for that and your patience with the caching issue with regards to the the forum updating.
You bet. Some of your posts were getting marked as spam, along with some other users. Happens from time to time. I’m marking as resolved.
Hey John,
Regarding the spam comment, do you know if these forums are using the bbPress Akismet plugin?
All of the *Press forums use Akismet. When you have as much activity as these collective forums get, you’ll have the occasional false positive from time to time. The algorithm that Akismet uses is always being adjusted to accommodate for this, but thankfully as we unmark posts that were incorrectly marked as spam, it learns as it goes and usually doesn’t happen again for that user.