BuddyPress Shortcodes Plugin
Editors note: This plugin is updated for BuddyPress 1.7 and many new features were added. Check it out!
A while back I thought about ways to make BuddyPress integrate with the regular posts and pages within WordPress better. I had no idea to properly display BuddyPress information in posts, sidebar or templates. So I came up with the idea to use WordPress Shortcodes to display BuddyPress related content anywhere.
Download Bowe Codes (BuddyPress Shortcodes)
So I approached iMath on Twitter can after some short Tweets send him a document containing all the shortcodes and their configuration options I had in mind. In record time he started worked on it, and decided to name the plugin after yours truly! I can die a happy man now.
So who is iMath anyway? Let’s use a shortcode and pull in his BP-Tricks information!
[bc_member name="imath" size="100" fields="About me,Website,Twitter Name"]
Shortcode used: bc_member name=”imath” size=”100″ fields=”About me,Website,Twitter Name”
It goes without saying that this makes creating custom BuddyPress related pages, widgets and even templates so much easier!
Available BuddyPress Shortcodes
Currently there are 10 shortcodes available:
- Member: Display a specific member
- Group: Display a specific groups
- Members: A list of members
- Groups: Displays a certain amount of groups
- My Friends: Displays friends of the displayed or logged in user
- My Groups: Displays groups of the displayed or logged in user,
- My Messages: Shows messages and the notifications of a logged in user,
- MultiSite Blogs: Allows you to show certain Blogs from your MultSite network
- MultiSite Posts: Displays specific posts from your MultiSite Network
Installation
You can download and install The BoweCodes plugin using the built in WordPress plugin installer. Or you can also download the plugin manually:
Download Bowe Codes (BuddyPress Shortcodes)
note: make sure it is uploaded to “/wp-content/plugins/bowe-codes/” Renaming the plugin is not a good idea because stuff will break!
Activate Bowe Codes in the “Plugins” admin panel using the “Network Activate” (or “Activate” if you are not running a network) link.
Inserting the BuddyPress Shortcodes in Post and Pages
After you’ve installed the plugin you’ll know see a cool icon in the post and page writing screen.
This button allows you to easily and quickly insert your shortcodes. Every shortcode has several configuration option that allow you to customize the output easily. Isn’t that awesome? Anyways here are some of the things you can expect:
- Avatar = Yes/No
- Avatar Size = “60″
- Type = “Features, Popular, New ” (Group and Member shortcodes)
- Amount = “10″ (amount of items to show)
- Class =”my_groups” (allows you to specify a specific CSS class to the output)
Just check out all of the options and experiment a bit.
Inserting the BuddyPress Shortcodes in Widgets and Templates
To enable the use of shortcodes in Text Widgets just add the following code to your (Child Themes) functions.php file
add_filter( 'widget_text', 'shortcode_unautop'); add_filter( 'widget_text', 'do_shortcode');
To output a shortcode in a template file just use this piece of code
Feature Suggestions?
You might have some ideas to improve this plugin or have questions about the usage. Just leave your ideas and suggestions in the comments. Finally be sure to thank iMath for his great work as well. For some crazy reason he does not take donations, but donations can be made to any other awesome BuddyPress project or Charity instead!
hi @Bowe,
Really nice post and wonderful new theme ! Great work
Bravo!
Great plugin! This could be a way to get BP “inside” WordPres themes.
That’s the idea.. In the future this can be used for all kinds of things.. like creating custom loops in posts and pages. So yeah.. the idea is to start using it anywhere in your theme. Please test it out as a designer, and see how you can use it.. I’m experimenting and trying to make a slideshow of avatars using the shortcodes.
Is it currently possible to use BP with a non-bp theme?
I concur, sweet plugin. I’m not sure what all I’ll use it for just yet, but it’ll definitely get some heavy use.
This is great…a few feature requests.
I would like to be able to show
1) Latest activity – i.e from the activity loop
2) Latest forum discussion
Hi Jamie,
i will work on these 2 new shortcodes. Just to be sure : when you say latest activity, do you mean all type of activity (including forum posts/blog posts, group membership…) or just the user updates ?
Thks for your feedback
Hi,
I mean all type of activity – although it would be great to be able to filter these in admin settings
I want to use your plugin on the home page of my hyperlocal community (and a few other sites i have built) to show all the activity that is going on within the site.
This would be perfect
Jamie
Hi,
Any news about this new shortcodes ?
Best Regards,
Laurent
I’m looking for these two for a very long time.. I agree it would be helpful to have it in this wonderful plugin!
Hi, one more thing.
Do you know how to style the members and groups horizontally rather than vertically?
Here’s my demo website. I would like members and groups to stretch accross the page rather than down it.
Jamie
oops i didnt include the url to my demo website. here it is http://www.socialpress.co.uk
Try something like this in your stylesheet –
.my_members li {
float: left;
font-size: 30px;
list-style-type: none;
display: inline;
padding-left: 26px;
}
That should indeed do the trick Josh.. I was about to post the same thing.. I’ll ask imath to someone make this an option
great it works
bowe , yes would be great to have this as an option
It would be great to have a built in configurable plugin – instead of editing code.
Would love if this plugin stays updated! Great work
Johnny
Hi, I just stubmbled across this plugin and it looks great! I was wondering if there are plans to include the abbility to pull forum/topic content via this shortcode plugin.
That would be a good idea.. I think that has to wait until BP 1.3 is out which has the BBPress Plugin integration!
Thnks for getting back to me bowe!
Hi, .. after the Installation appears that on BCodes Options:
file_get_contents(http://“web”/wp-content/plugins/bowe-codes/css/default.css) [function.file-get-contents]: failed to open stream: HTTP request failed! HTTP/1.1 401 Authorization Required in C:\wamp\www\”web”\wp-content\plugins\bowe-codes\includes\bowe-codes-admin.php on line 8
“web” is my website URL (ip:port/web_name)
thanks
I think you should try a chmod on the /wp-content/plugins/bowe-codes/css/default.css
you can also simply comment the line 8 of /wp-content/plugins/bowe-codes/includes/bowe-codes-admin.php as the goal here was to simply show the content of default.css.
This is almost perfect for what I need! Thanks!
I need to pull posts from a specified group, or even one individual post and have it appear within a wordpress page.
I think this might be what I want but I am not sure. When members log into BP they can start writing away on their home page — but this is not always easy for other people to find. I would like to gather up all comments and posts into the one page (I call blogs). Is this something that this plugin can do? If so, how? If not, do you have any idea how I can find this facility?
I’ve got a huge problem, but for the most part this is great. I couldn’t figure out how to include buddypress “about the author” profile information at the bottom of my main site posts. With your shortcodes, I was able to use them as part of the form template when a user-contributed post is submitted via gravity form plugin.
I just have one big problem. I can’t get the urls to automatically link. I’ve even tried using the auto-hyperlink-urls plugin, but I just can’t get it to pick these up. My profile includes fields to twitter, facebook, and the user’s website. I’d also like to add other buttons within it, such as follow on twitter, follow on prprofile, etc.
Any suggestions?
Hi Theo,
That’s some creative usage of the shortcodes plugin. But I think you’d be better of with a stand alone author box that shows the avatar and profile info of the author right? I have that working here on BP-Tricks, so I’ll write a tutorial about how I pulled that of next week. In the meantime I’ll ask imath if he knows the answer to your question!
Thanks! That’s exactly what I need. I’ll tell you what, there’s hardly anything on the web about getting buddypress profile information into an “about the author” section. I know I’m not the only one that has contributed content! You’d think there would be a plugin for that somewhere.
Thanks again!
I’m trying to use this plugin to replicate the result I currently achieve with the People List plugin. It’s not a suitable plugin for sites with thousands of members, hence the switch.
I intend to use your plugin for our team page. Problem is, I don’t have any overview of these “fields” you speak of. Furthermore, I don’t think you support fields from the WordPress profile page, do you?
I’m using:
First name,
Last name,
Status (custom field),
Role (custom field),
About yourself.
Is there a way to easily implement that list using your shortcodes plugin?
Hey
what a great plugin! I’m not sure if it can help solve my problem (long version here: http://buddypress.org/community/groups/how-to-and-troubleshooting/forum/topic/need-urgent-help-gonna-pay/)
Short version: WP/BP is installed in a subdirectory of Slople so far, but I would like to show the activity-stream of groups and the members of those groups outside of WP – I think I need to “wp-enable” those pages, but I don’t know how…
Would appreciate any feedbacks!
Raphael
I was actually looking for the opposite of this but this is just as awesome! I wanted to use wordpress shortcodes in buddypress, for example blog posts in activity streams and posting updates and forum posts. If that does not exist maybe it can become a feature some day ; )
Anyway to use these in emails sent out via buddypress? Would nice to include some popular groups, members, etc in the footer of the emails.
Great plugin, I’m impressed with what you have done. I’ve been able to use bowe shortcodes on post and text widget. However, I’m having challenges with it on my template/page. I’m using the buddypress default theme and whenever I paste in the index file, nothing seems to show. I’m still new with php. Kindly explain further how to get it to work on template. Thanks
Nice plugin but I get 404 errors because my site is in a sub directory. How can I fix this?
Is it possible to call top 5 BP Reviews from the middle of a post via shortcode? just wondering… thx
Internal Server Error
`The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator and inform them of the time the error occurred, and anything you might have done that may have caused the error.
More information about this error may be available in the server error log.`
Got this when I tried to install using the dashboard plugin installer. Was I meant to create a special directory to upload it into?
Never mind, I uploaded it manually and it worked.
Hi !
Finaly a good shortcode for BP !
I have a suggest.. the list of members (with avatar…) for a specify group isn’t ?
cheers
great idea. but no profile shortcode??????
Great plugin! Just getting the hang of it using it together with custom fields. Works great. Thanks a ton.
Graag gedaan Jelle! Laat me even weten als je er wat leuks mee gedaan hebt
Ha Bowe, er zit volgens mij een bug in bowe-codes.php. Wanneer je de buddypress pagina’s aanpast, bijv members pagina naar students pagina dan veranderen de permalinks van de leden niet mee wanneer je de shortcode gebruikt. Ik heb het nu zelf handmatig aangepast door op lijn 94 .BP_GROUPS_SLUG. te veranderen in .bp_get_root_slug(leden)., maar dat is natuurlijk niet ideaal.
Its like you learn my mind! You seem to understand a lot approximately this, such as you wrote the guide in it or something. I believe that you could do with some p.c. to drive the message home a little bit, but other than that, that is great blog. A great read. I will definitely be back.
An alternative found for listing your members horizontally rather than vertically is
.my_members li
{ display:-moz-inline-box; -moz-box-orient:vertical;
display:inline-block; vertical-align:top; word-wrap:break-word; }
* html #test6 li { display:inline; }
* + html #test6 li { display:inline; }
* html #test6 li { width:60px; }
#test6 li > * { display:table; table-layout:fixed; width:60px; overflow:hidden; }
And it will be cross browser compatible.
.my_members li { display:-moz-inline-box; -moz-box-orient:vertical;
display:inline-block; vertical-align:top; word-wrap:break-word; }
* html #my_members li { display:inline; }
* + html #my_members li { display:inline; }
* html #my_members li { width:60px; }
#my_members li > * { display:table; table-layout:fixed; width:60px; overflow:hidden; }
Actually, sorry, forgot I was using my own custom css there for a second.
Hello,
first of all thanks for this great plugin.
I would like to request a feature.
Sometimes I ask users to enter a list of items, but whenever I call it with Bowe_Codes in a post, it comes out list this:
List of items: Array
Instead of
List of items:
- Item one
- Item two
- Item three
I would like it come out the list of the items, and each item on a separte line.
Thank you in advance.
Hi thanks for this plugin but its only working with BP themes… if we want to incluide it on a wordpress theme doesnt work
Hi,
Can you make an 11th short code that gets the current user that’s logged in profile avatar?
I need it for a theme I’m redesigning.
Is this possible? I want to use a short code within a post to do this. Not do it via PHP.
Thanks
Johnny
I have made a comment with imath – please see the following:
#comment-5134
Cheers,
Johnny
Hi , this is so useful.
Feature ideas: Newest members for a specific group, a forum topic comments,
These are one of the plugins which makes me want to get a WPMU mbhreesmi however, the site doesn’t do itself any favours when there are no plugin demoes and when it just shows the back-end I want to see how it looks like on the front, the different styles I can show the donation page. The featured image was taken from Kickstarter, does it look anything like that?I need more examples of it in action
bp_group doesn’t show a hidden group. Any fix?
11/23/2010 at 4:09 amjQuery is included in WP core and is very easy to use, with next to none leaninrg curve. I’m using many shortcodes and started to think about writing something like this, so before coding I looked for similar plugins, found it. Its great idea! Your drag and drop idea is better than editor menu, since you can see all the plugins and drag and drop. The only thing I’m thinking about since I found it is the way to make it generic: should enable to add description and parameters to any shortcode in a convenient way. my idea is to use WP thickbox and on shortcode click event to open the thinkbox to put in the parameters for the shortcode, if the shortcode does not have a description and parameters list to enable to add it, there are some plugins that add a editor button that is doing the same. All the data tructure should be saved as option of this plugnig (using serialize/unserialize for saving array as option) and it should include the most popular plugins shortcodes data to begin with. My suggestion for data structure is: array( shortcode’ =>array( Caption’,'insert code’,array(array( parameter1 name’,'parameter1 description’,'optional flag’,'valid values’,'value’),array( parameter2 name’,'parameter2 description’,'optional flag’,'valid values’,'value’)))I hope to find sometime this weekend to play around with this.Anyway thanks for this plugin, great work!Zafrir
This is such a great plugin thank you. One thing I would love to know how to do, is to insert the profile fields for the current member, I see you can display a specific member’s profile fields, but not the current logged in user. Would this be possible?
Ideas: bp forum shortcodes like http://bbpress.org/forums/topic/bbpress-20-shortcodes.
letters and numrebs but when I tried to use a number, it said letters only . So I tried again. It said Lower case letters only didn’t say that at first!And that’s not even including the full screen’ stuff. That might have just been me hitting the wrong key of course. If it was, sorry for even mentioning it. If it was you guys .. grrrr! Took me ages to get back out!Anyway . thanks! [All the previous stuff is mostly meant to be helpful / constructive feedback ]
hey Bowe – any chance you could let us know how to simply get the name of the currently logged in user? this would be immensely helpful!
thanks for this awesome plugin
Thanks for a great plugin.
It would be great to add a shortcode to create a new group with variables that allow a placeholder for associating the group with a post.
Donec interdum, enim in disgsinim lacinia, lectus nisl viverra lorem, ac pulvinar nunc ante at neque. Proin et dui eros, at aliquet est. Pellentesque consectetur lectus quis enim mollis ut convallis urna malesuada. Sed tincidunt interdum sapien vel gravida. Nulla a tellus lectus, in aliquet tellus. Donec aliquam neque quis mi vestibulum ut cursus velit consectetur
I get a page not found error when I click on the bcodes button in the editor, are there known conflicts with other plugins?
Exactly what I was looking for!
Thank you.
~eric
Would be great to be able to display a random member(s) depending on a profile field.. ie show a random selection of members(number displayed definable) who have a field of Gender = male…
can we display the blogs author in the sidebar widget of that blog ?
we are using another plugin but having some issues..
Below is an example link of what i need it to do where we show the store owners social profile Name/avatar,etc in their sites/blogs sidebar so users may go to their bp profile to further communicate…
we would also be interested in adding a My Profile page to the blogs/sites in our case where a short code would show some of the x-profile fields to take the user to that blog authors bp profile…
look at the top of the sidebar under Visit my Profile widget, thats what we need …
how would i format it for a widget to do that or a page i may include inside users blogs called My Profile….
craftsinstyle.com/basicstore/ <–
there is huge demand for such a feature and so far Brajesh has a plugin to do just that but we cant get much support on few things so here we are loving this shortcode plugin but wondering how to accomplish our goal so we can include that once in beta next week …
I want to use shortcode bc_member for actually logged in user, not exactly defined user name. How to do it? Thanks
How do I get the bp groups to be listed horizontally instead of vertically?
I’m looking to display new posts from all network blogs sitewide. So far, I’ve been able to get the updates to show, saying “Admin posted such and such to this site”, but what I want is to see the actual post, images, text and all. I’m trying to recreate how Tumblr looks, and you see posts from people you are following. I’d love a way to display only those posts where you are following certain blogs. I’d love to display posts using category hashtags. I should probably just ask: Are you for Hire?
Thanks