• Resolved anelka22

    (@anelka22)


    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.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author micropat

    (@micropat)

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

    Thread Starter anelka22

    (@anelka22)

    Thank You .

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Buddypress integration and WordPress comments’ is closed to new replies.