I’m new to BP but I’ve learnt that some things in the code are contextually bound. Something higher up in the hierarchy may be missing.
I’ll want to do the same thing tho. Can you explain what code you took from where?
@Tore thanks for looking into this.
Actually what worked best for me was just copying the code from directories/forums/forums-loop onto home.php.
It does the same output as on the forums, but the actual link will forward to “not found” AND the group that it was posted in is not showing either.
The link looks like this:
http://site.com/profile/public/forum/topic/title/
Instead of this:
http://site.com/groups/group/forum/topic/title/
Try this plugin (works with 1.1)
https://wordpress.org/extend/plugins/bbpress-latest-discussion/
number of post and forums can be set in plugin option
Thanks Chouf1, seen it b4, still I’d like to do this without a plugin if possible!
You can use the activity stream to pull this information and then filter it.
<?php if ( bp_has_activities(
'per_page=10&
max=10&
object=groups&
action=new_forum_topic,new_forum_post'
) ) : ?>
<ul id="activity-list" class="forum-posts">
<?php while ( bp_activities() ) : bp_the_activity(); ?>
<li class="<?php bp_activity_css_class() ?>">
<?php bp_activity_content() ?>
</li>
<?php endwhile; ?>
</ul>
<?php else: ?>
<div id="message" class="info">
<p>No latest forum posts.</p>
</div>
<?php endif;?>
This will list the last 10 forum topics or forum posts site wide.
Oh very interesting approach, thanks Andy!
though it does not work as intended right now: I’ve got the sitewide activity widget in the sidebar, so whenever I click on a filter as groups, friends etc. your code will change as well and display the latest 10 friendships for example.
Although the action line should prevent that right, new_forum_topic,new_forum_post?
Andy,
I’ve tried using the code loop you’ve given above on my front page, but it doesn’t filter to just show the forum activity.
It’s showing all the site activity, i.e. the action filter doesn’t seem to be having any effect.
Any thoughts?
Are you using BP 1.1.3 Roger? It might only work on BP 1.2.
Hi Paul,
yes… we are on 1.1.3
Andy’s post was 3 months ago, so I assume the code loop / bp_has_activities call was for a 1.1.x version, rather than the forthcoming 1.2.
Any other thoughts?
Cheers, Roger
@Rogercoathup have you figure out the activities loop for 1.2 by chance?
@bpinspire – Hi, no I haven’t tried upgrading that theme to 1.2, so not sure whether the activities loop is now working. We are building a new site at the moment, but that will aggregate its forum content from an RSS feed from ‘external’ forums implemented using SimplePress