It’ll involve some custom theming and the AddToAny share buttons template tag. For example, here’s how to add the share buttons to each BuddyPress comment…
In your BuddyPress theme’s comment.php file, you’ll add this snippet:
<?php
if ( function_exists( 'ADDTOANY_SHARE_SAVE_KIT' ) ) {
ADDTOANY_SHARE_SAVE_KIT( array(
'linkname' => bp_get_activity_comment_name(),
'linkurl' => bp_get_activity_comment_permalink(),
) );
echo '<script>if (a2a) a2a.init("page");</script>';
}
?>
Add the snippet right before this line:
<?php bp_activity_recurse_comments( bp_activity_current_comment() ); ?>
(The function might be named bp_nouveau_activity_recurse_comments instead.)
(@anelka22)
2 years, 5 months ago
Good morning,
Is it possible to add the AddToAny share buttons in WordPress and buddypress comments? to allow sharing of comments, a user’s buddypress profile and buddypress activities? if yes can you give us code snippets to do it? Thanks in advance.