BuddyPress Shortcodes Plugin

banner_light

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.

screenshot 3 BuddyPress Shortcodes Plugin

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!

BuddyPress Hosting Guide Looking for quality BuddyPress hosting? We will guide you through all the available hosting options and help you find the best webhost for your next BuddyPress project!

Something about bowe

BuddyPress fanatic, WordPress Theme designer and MultiSite community builder. Proud co-founder of PressCrew. Loves to use awesome in every sentence. Often described as a Dutch Treehugging Hippie.

66 Responses to BuddyPress Shortcodes Plugin

  1. imath May 18, 2011 at 5:54 pm #

    hi @Bowe,

    Really nice post and wonderful new theme ! Great work ;)
    Bravo!

    Reply
  2. modemlooper May 18, 2011 at 7:13 pm #

    Great plugin! This could be a way to get BP “inside” WordPres themes.

    Reply
    • bowe May 18, 2011 at 7:24 pm #

      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. :)

      Reply
      • Greg Fielding May 19, 2011 at 4:57 pm #

        Is it currently possible to use BP with a non-bp theme?

        Reply
  3. Josh Jenkins May 18, 2011 at 7:24 pm #

    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.

    Reply
  4. jamie marsland May 19, 2011 at 8:17 am #

    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

    Reply
    • imath May 19, 2011 at 12:09 pm #

      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 ;)

      Reply
      • jamie marsland May 19, 2011 at 12:21 pm #

        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

        Reply
      • Laurent September 5, 2011 at 8:14 pm #

        Hi,

        Any news about this new shortcodes ?

        Best Regards,
        Laurent

        Reply
    • Natalie @ GoForFun.com.au February 12, 2012 at 5:02 am #

      I’m looking for these two for a very long time.. I agree it would be helpful to have it in this wonderful plugin!

      Reply
  5. jamie marsland May 19, 2011 at 8:48 am #

    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

    Reply
    • jamie marsland May 19, 2011 at 12:23 pm #

      oops i didnt include the url to my demo website. here it is http://www.socialpress.co.uk

      Reply
    • Josh Jenkins May 19, 2011 at 2:56 pm #

      Try something like this in your stylesheet –
      .my_members li {
      float: left;
      font-size: 30px;
      list-style-type: none;
      display: inline;
      padding-left: 26px;
      }

      Reply
      • bowe May 19, 2011 at 3:00 pm #

        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 :)

        Reply
      • jamie marsland May 19, 2011 at 3:05 pm #

        great it works :)

        bowe , yes would be great to have this as an option

        Reply
  6. Johnny May 19, 2011 at 10:04 pm #

    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

    Reply
  7. Avi M May 26, 2011 at 11:50 pm #

    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.

    Reply
    • bowe June 1, 2011 at 9:40 am #

      That would be a good idea.. I think that has to wait until BP 1.3 is out which has the BBPress Plugin integration!

      Reply
      • Avi M June 6, 2011 at 9:41 pm #

        Thnks for getting back to me bowe!

        Reply
  8. Manuel June 5, 2011 at 8:59 pm #

    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

    Reply
    • imath June 11, 2011 at 6:44 pm #

      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.

      Reply
  9. zuko June 15, 2011 at 8:06 pm #

    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.

    Reply
  10. Philip Cowan June 23, 2011 at 10:42 am #

    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?

    Reply
  11. Tony June 25, 2011 at 6:45 pm #

    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?

    Reply
  12. Bowe June 25, 2011 at 6:55 pm #

    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!

    Reply
    • Tony June 25, 2011 at 7:01 pm #

      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!

      Reply
  13. Erlend Sogge Heggen July 1, 2011 at 6:46 pm #

    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?

    Reply
  14. Raphael July 11, 2011 at 7:39 am #

    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

    Reply
  15. jf0 July 12, 2011 at 2:47 am #

    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 ; )

    Reply
  16. Mistafo July 15, 2011 at 9:35 pm #

    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.

    Reply
  17. Timmy July 20, 2011 at 3:31 pm #

    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

    Reply
  18. Calzo September 5, 2011 at 5:54 pm #

    Nice plugin but I get 404 errors because my site is in a sub directory. How can I fix this?

    Reply
  19. Johnny September 20, 2011 at 8:41 am #

    Is it possible to call top 5 BP Reviews from the middle of a post via shortcode? just wondering… thx

    Reply
  20. JJStreat September 23, 2011 at 3:13 pm #

    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?

    Reply
  21. JJStreat September 23, 2011 at 3:16 pm #

    Never mind, I uploaded it manually and it worked.

    Reply
  22. Rémi October 3, 2011 at 3:25 pm #

    Hi !
    Finaly a good shortcode for BP !

    I have a suggest.. the list of members (with avatar…) for a specify group isn’t ?

    cheers

    Reply
  23. Brian Lasher October 4, 2011 at 4:16 pm #

    great idea. but no profile shortcode??????

    Reply
  24. Jelle Brouwer October 28, 2011 at 10:46 pm #

    Great plugin! Just getting the hang of it using it together with custom fields. Works great. Thanks a ton.

    Reply
    • bowe November 2, 2011 at 1:02 pm #

      Graag gedaan Jelle! Laat me even weten als je er wat leuks mee gedaan hebt :-)

      Reply
      • Jelle Brouwer November 30, 2011 at 2:20 pm #

        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.

        Reply
  25. url shortener October 29, 2011 at 7:43 am #

    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.

    Reply
  26. Nathan November 19, 2011 at 10:36 pm #

    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.

    Reply
    • Nathan November 19, 2011 at 10:38 pm #

      .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.

      Reply
  27. gixty November 25, 2011 at 8:46 am #

    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.

    Reply
  28. mimo December 23, 2011 at 8:21 pm #

    Hi thanks for this plugin but its only working with BP themes… if we want to incluide it on a wordpress theme doesnt work

    Reply
  29. Johnny February 19, 2012 at 5:01 am #

    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

    Reply
  30. Johnny February 26, 2012 at 12:41 am #

    I have made a comment with imath – please see the following:

    #comment-5134

    Cheers,

    Johnny

    Reply
  31. Stacy March 1, 2012 at 4:31 am #

    Hi , this is so useful.
    Feature ideas: Newest members for a specific group, a forum topic comments,

    Reply
    • May 29, 2012 at 11:47 pm #

      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

      Reply
  32. Daisy Peel March 7, 2012 at 4:15 am #

    bp_group doesn’t show a hidden group. Any fix?

    Reply
    • May 30, 2012 at 5:06 am #

      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

      Reply
  33. Amanda March 13, 2012 at 4:15 pm #

    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?

    Reply
  34. Stacy March 19, 2012 at 3:29 am #

    Ideas: bp forum shortcodes like http://bbpress.org/forums/topic/bbpress-20-shortcodes.

    Reply
    • May 30, 2012 at 11:32 am #

      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 ]

      Reply
  35. Andy Moore March 27, 2012 at 6:12 pm #

    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

    Reply
  36. John April 20, 2012 at 4:14 pm #

    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.

    Reply
    • May 30, 2012 at 1:02 am #

      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

      Reply
  37. jayham May 23, 2012 at 1:38 pm #

    I get a page not found error when I click on the bcodes button in the editor, are there known conflicts with other plugins?

    Reply
  38. Eric Langley June 1, 2012 at 3:06 am #

    Exactly what I was looking for!

    Thank you.

    ~eric

    Reply
  39. Nick July 24, 2012 at 5:49 am #

    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…

    Reply
  40. Robert Vayner August 2, 2012 at 12:58 pm #

    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 …

    Reply
  41. Milan Tucek January 18, 2013 at 1:27 am #

    I want to use shortcode bc_member for actually logged in user, not exactly defined user name. How to do it? Thanks ;-)

    Reply
  42. drusteezDrew April 29, 2013 at 1:10 pm #

    How do I get the bp groups to be listed horizontally instead of vertically?

    Reply
  43. tywest01 July 13, 2013 at 11:23 am #

    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?

    Reply
  44. carlos July 19, 2013 at 3:14 am #

    Thanks

    Reply

Trackbacks/Pingbacks

  1. Bowe Codes, 10 shortcodes BuddyPress ! » imath.. - May 18, 2011

    [...] Télécharger le plugin   Lire les explications du concepteur. [...]

Leave a Reply