BuddyPress Activity Shortcode plugin allows you to embed BuddyPress activities in posts/pages using shortcodes.
Here is a sample use example
That will list the most recent 5 activities.
Here is a screenshot:-
Here is the way you can specify options
[activity-stream option_name=option_val option_name2=option_val2 and so on]
The accepted parameters:-
- title(string) :- what should be the title of the activities section
- pagination(int):- 0 or 1(do you want to hide or show the activity pagination at the bottom of the list)
- display_comments(sting, int):- possible values are threaded|stream|0(use 0 to hide activity comments)
- include(int|string):- individual activity id or comma separated list of activities, useful in case you want to list specific activities
- exclude(int|string):-individual activity id or comma separated list of activities, useful in case you want to exclude specific activities from the list
- sort(string):- ASC|DESC (how to sort the activities in ascending or descending order)
- page (int):- which page to load, e.g 1st page or 10th page of activity
- per_page(int):- How many activities per page(default is 5)
- max(int):- Limit the maximum no. of activities to be included in the list
- scope(string):- – pre-built activity filters for a user (possible values are friends/groups/favorites/mentions)
- user_id(int):- If you want to list a particular user’s activity
- object(string):- object to filter on e.g. groups, profile, status, friends(what type of activity is this)
- action(string):- action to filter on e.g. activity_update, new_forum_post, profile_updated(why this activity was created)
- primary_id(int):- object ID to filter on e.g. a group_id or forum_id or blog_id etc. We will see the use in a minute.
- secondary_id(int):- secondary object ID to filter on e.g. a post_id(I don’t think you are going to use it)
- search_terms(String):- In case you want to list the results of activity search
- allow_posting(int):- If you want to allow users to post. It will include the default activity posting form. It is experimental and may have issues on some of the themes.
- hide_on_activity(int):- Default 1. Hide/show the shortcode content on activity pages(If you are using it in sidebar and want it to be visible on user/group/site activity page, set it to 0)
- container_class(string):- Default ‘activity’ . Allows to change the class of the shortcode contents wrapper. If you have the hide_on_activity=0, then please set it to some other value than ‘activity'(May be ‘activities’ or something else). If you do not change it, On the user/group/site activity page, the activity filter will affect the content of the shotrcode. It is suggested to change it if hide_on_activity=0 is set.
We will see some examples in a minute. Before that, I will just like to clarify that you can use the combination of above options to list any type of activity you want.
List all activities of user with user_id=1
List 10 recent activities per page:-
List activities containing word “awesome”
List all group activities:-
List all activities of the group Batman Fan club(Assuming that the group id is 2)
[activity-stream object=groups primary_id=2]
Well guys, It’s up to you to explore the possibilities.