• Hello Everyone,

    On my profile page, If login user self and check follower or following then in follower member list and in following member list **Follow/Unfollow** button not display. If I visit other user page then follow / unfollow button display.
    Ex. on self profile (On login user page)
    https://prntscr.com/11xfid5

    For other Member profile page

    https://prntscr.com/11xfqx7

    To get button I have used this code
    $args = array(‘leader_id’ => $user_id, ‘follower_id’ =>$author_id, ‘link_text’ => ”, ‘link_class’ => ‘fa fa-user-plus’, ‘wrapper’ => ”);
    echo bp_follow_get_add_follow_button($args);

    So please let me know what issue with login user page ?
    **Please Respond ASAP because this is urgent for my site**

    Thanks

Viewing 1 replies (of 1 total)
  • Thread Starter duhar81

    (@duhar81)

    Complete code for button are this. If I am wrong then please correct me.

    <div class="buttons">
                        <?php
                        $author_id =bp_displayed_user_id();
                        $user_id = $val->ID;
                        if (bp_follow_is_following(array('leader_id' => $author_id, 'follower_id' => $user_id))) {
                            $link_text = sprintf(__('Unfollow', 'artgorae'));
                        } else {
                            $link_text = __('Follow', 'artgorae');
                        }
    
                        $args = array('leader_id' =>  $user_id, 'follower_id' =>$author_id, 'link_text' => '', 'link_class' => 'fa fa-user-plus', 'wrapper' => '');
                        // print_r($args);
                        echo bp_follow_get_add_follow_button($args);
                        ?>
                    </div>
Viewing 1 replies (of 1 total)
  • The topic ‘Follow and following button not display’ is closed to new replies.