Is there a latest forum topic widget?
-
Would love a sidebar widget displaying the latest 5 or so forum topic titles? Is this available anywhere?
Cheers
Ross
-
It´s included in the BuddyPress Forums Extras plugin.
correct, under the forum index sub-plugin. (you can set the max topics)
it calls bp_has_forum_topics so if viewed from a group page or profile page – it will filter for those components as well.
@nuprn1 Great stuff! This is exactly what I need but I only need the widget and not the index. The index is a great idea but I have 2000 groups so isn’t really suitable.
I’m a bit of a numpty when it comes to extracting code but would really like to hear how I can use just the widget without the index! I’d even pay for this to be made into a standalone widget.
Cheers
Rosswell the easiest way is to just extract the snippet and replace a line of code
open up
bp-forum-extras-index.phpplace this class BP_Forum_Extras_Index_Latest_Topics_Widget extends WP_Widget into the bp-custom.php file
then replace the line
if ( bp_forum_extras_blogs_component() )
with
if ( $bp->forums->slug == $bp->current_component )@nuprn1 Sorry for having to ask such simple questions but I am exactly that… Simple!
Wen you say ,’place this class BP_Forum_Extras_Index_Latest_Topics_Widget extends WP_Widget into the bp-custom.php file’
What am I actually placing in the custom php file?
I’m not sure how much of the code I am cutting and pasting?So sorry, I’m just learning!
Thanks so much!i posted it here (easier to see the code)
http://etivite.com/groups/buddypress/forum/topic/quick-tip-widget-display-latest-topics-from-group-forums/#topic@nuprn1 Thanks so much.
So I have pasted that code into my bp-custom.php file.So should the widget show up or do I need to activate the sub plugin. Will that not activate the forum index with it? I just need the widget. We’re nearly there!
wp-admin > appearance > widgets
@nuprn1 Hmm… maybe I have done something wrong but I have pasted the code in and yet I can’t see a widget?
thanks rich!
So sorry, I just can’t get this to work.
I have copied the code from your post to my clipboard and pasted it between php tags in my bp-custom.php file but no widget is showing. Do I have to activate any of the forum extras plugins for it to work?
I just need this widget and not the forum index.I have other code in my bp-custom.php file that works so not sure why adding this code in there doesn’t.
Apologies once again as I’m clearly doing something wrong but I just don’t know what.
Thanks for your patience!you have to activate the widget under wp-admin > appearance > widgets (drag it to the sidebar)
@nuprn1
looks like your Forum-plugin is working nice, but I am also having a huge number of Groups (around 2k), so is there a chance to get this Plugin without the Forum-Index included in the Widget ?
Or is there a chance to activate / deactivate the Forum-Index in the backend ?I am not a programmer so I am not able to fiddle around in any code.
Many thanks,
Erich
@nuprn1 thats the only thing, it isnt showing in the widgets section. There isnt a latest topics widget to drag across.
oh sorry, i forgot to include the register widget hook
function my_register_widgets_init() {
add_action(‘widgets_init’, create_function(”, ‘return register_widget(“Whatever_You_Named_It_Latest_Topics_Widget”);’) );
}
add_action( ‘bp_register_widgets’, ‘my_widgets_init’, 15 );@nuprn1
Ahhh, that must be it then! Does this go in the bp-custom.php file too or elsewhere and if it does go in custom.php should it be before or after your code?
Thanks!yep same file, below – make sure to change “Whatever_You_Named_It_Latest_Topics_Widget” to the name of the widget class
I’ve installed and activated this. Widgets are showing up nicely in my “members” sidebar, but it will not show in my homepage sidebar. Any idea of why?
the only pages it won’t load on is forum component index || bp_is_register_page() || bp_is_activation_page() || bp_is_user_blogs()
the only pages it won’t load on is forum component index || bp_is_register_page() || bp_is_activation_page() || bp_is_user_blogs()
Sorry, is ^^^^ in response to my post? I do’t understand what that means. I have the widget placed on my blog index page and it’s not showing.
@nuprn1
When you said ‘make sure to change “Whatever_You_Named_It_Latest_Topics_Widget” to the name of the widget class’I don’t think Im doing this right. I have just copied your original code you supplied so what class do I need to put in the function?
I keep getting a white page when I try.Cheers,
RossHI,
No matter what I do, the widget won’t appear on my home page. Can you please point me in the right direction?
Thanks.@tfblogs Like I mentioned above – those are the only pages explicitly where the widget won’t load up. If you grab just the widget code off my demo site – then you can modify it to suit your needs. (hard for me to know what is causing your problem – tested with frontpage set as activity stream or blog posts and it works fine here)
@rossagrant – i updated the code on my demo site with a different naming schema – just grab all the code from there again. (as the same name with the forum extras plugin would cause a WSOD)
thanks for the new code! I have this working now!
the only thing that is happening now is that the widget is displaying a ? in a black diamond before the title of each topic in the widget.I am using WP 3.0.
Is this something to do with an unrecognised character or something?
Cheers.I give up. As much as I like this plugin, I can’t get it to appear on any sidebar outside of the members sidebar.
- The topic ‘Is there a latest forum topic widget?’ is closed to new replies.