BuddyBoss Home – Web › Support Forums › Solutions › Social Learner › Custom post type in Activity stream
- This topic has 12 replies, 3 contibutors, and was last updated 8 years, 8 months ago by Anonymous.
Question
March 14, 2016 at 11:30 pm #63033@vhankimHello, Boss!
I want to add the custom post types (eg. product, portfolio, etc..) in activity stream.
I tried following the ‘Bp Codex _ https://codex.buddypress.org/plugindev/post-types-activities/‘ document.But.. Stream is no change..
Where to add the that code?
Answers
March 15, 2016 at 3:10 am #63071@
AnonymousHi @vhankim, Custom post type in Activity stream is now Buddypress default feature you do not need any code to include it in your activity.
Regards
March 15, 2016 at 3:16 am #63072@vhankimHi @pallavi.
Um… but why do not appear the woocommerce ‘product’ types??
How can i setting in?
March 17, 2016 at 12:15 pm #63657@
AnonymousHi @vhankim
You can add following code to child theme functions.php to add support for WooCommerceadd_post_type_support( 'product', 'buddypress-activity' );
For further details you can check
Regards
Varun DubeyMarch 18, 2016 at 1:57 am #63739@vhankimHi @vapvarun
I tried in your way. However, there is no change.
March 18, 2016 at 6:45 am #63806@
AnonymousHi @vhankim
to display inside filter dropdown, you will added to add additional arguments
function customize_product_tracking_args() { // Check if the Activity component is active before using it. if ( ! bp_is_active( 'activity' ) ) { return; } bp_activity_set_post_type_tracking_args( 'product', array( 'component_id' => buddypress()->blogs->id, 'action_id' => 'new_product', 'bp_activity_admin_filter' => __( 'Published a new product', 'custom-domain' ), 'bp_activity_front_filter' => __( 'Products', 'boss' ), 'contexts' => array( 'activity', 'member' ), 'activity_comment' => true, 'bp_activity_new_post' => __( '%1$s posted a new <a href="%2$s">product</a>', 'boss' ), 'bp_activity_new_post_ms' => __( '%1$s posted a new <a href="%2$s">product</a>, on the site %3$s', 'boss' ), 'position' => 100, ) ); } add_action( 'bp_init', 'customize_product_tracking_args' );
March 18, 2016 at 10:18 pm #63948@vhankimHi @vapvarun.
I tried but not change anything…
custom post types(product and page, etc..) not appear in stream, dropdown menu..
March 18, 2016 at 11:19 pm #63967@
AnonymousHi @vhankim
To add Product
add_post_type_support( 'product', 'buddypress-activity' ); function customize_product_tracking_args() { // Check if the Activity component is active before using it. if ( ! bp_is_active( 'activity' ) ) { return; } bp_activity_set_post_type_tracking_args( 'product', array( 'action_id' => 'new_product', 'bp_activity_admin_filter' => __( 'Published a new product', 'custom-domain' ), 'bp_activity_front_filter' => __( 'Products', 'boss' ), 'contexts' => array( 'activity', 'member' ), 'activity_comment' => true, 'bp_activity_new_post' => __( '%1$s posted a new <a href="%2$s">product</a>', 'boss' ), 'bp_activity_new_post_ms' => __( '%1$s posted a new <a href="%2$s">product</a>, on the site %3$s', 'boss' ), 'position' => 100, ) ); } add_action( 'bp_init', 'customize_product_tracking_args' );
To add page
add_post_type_support( 'page', 'buddypress-activity' ); function customize_page_tracking_args() { // Check if the Activity component is active before using it. if ( ! bp_is_active( 'activity' ) ) { return; } bp_activity_set_post_type_tracking_args( 'page', array( 'action_id' => 'new_blog_page', 'bp_activity_admin_filter' => __( 'Published a new page', 'boss' ), 'bp_activity_front_filter' => __( 'Pages', 'boss' ), 'contexts' => array( 'activity', 'member' ), 'activity_comment' => true, 'bp_activity_new_post' => __( '%1$s posted a new <a href="%2$s">page</a>', 'boss' ), 'bp_activity_new_post_ms' => __( '%1$s posted a new <a href="%2$s">page</a>, on the site %3$s', 'boss' ), 'position' => 100, ) ); } add_action( 'bp_init', 'customize_page_tracking_args' );
http://screencast-o-matic.com/watch/cDeqhb13NF
You can also check with BuddyPress supportBuddyPress support forum: https://buddypress.org/support/
Regards
Varun DubeyMarch 18, 2016 at 11:54 pm #63972@vhankimHi. @vapvarun
I’ve tried your way.
First, the drop-down menu in the activity profile page looks good.
However, the stream function does not work.Then, the stream does not apply and the drop-down menu in the overall site activity stream.
March 19, 2016 at 12:04 am #63974@
AnonymousHi @vhankim
It will be better You check with BuddyPress support, These are beyond theme support.
Regards
Varun DubeyMarch 19, 2016 at 3:47 am #63987@vhankimHi @vapvarun.
I was checked the theme. When activated boss-child & Social-learner, stream and drop-down menu works well in user’s activity page.
However, stream & menu not work in overall site activity page.When activated twentysixteen theme, all works well.
March 19, 2016 at 10:12 pm #64102@vhankimI did it! 🙂
I was added menu code in buddypress > activity > index.php
March 21, 2016 at 12:41 pm #64343@
AnonymousGreat 🙂
Regards
- The question ‘Custom post type in Activity stream’ is closed to new replies.