BuddyDev

Search

Display change profile link

  • Participant
    Level: Guru
    Posts: 900
    Tosin on #20221

    Hello,

    I am using the code below in my member-header.php file

    <div id="change-avatar-link">
    <a href="<?php echo bp_loggedin_user_domain() ?>profile/change-avatar/">Change Your Avatar!</a>
    </div>

    The problem now is that the link is also appearing on other members profile where by the link still redirects back to my own profile. How can I prevent the link from showing on others members profile. Only the currently logged in user should see the link in his profile and not other members profile header.

    Thanks

  • Keymaster
    (BuddyDev Team)
    Posts: 24623
    Brajesh Singh on #20314

    Hi Tosin,
    You can put it inside a condition like this

    
    
    <?php if ( bp_is_my_profile() ) : ?>
    <div id="change-avatar-link">
    	<a href="<?php echo bp_loggedin_user_domain() ?>profile/change-avatar/">Change Your Avatar!</a>
    </div>
    <?php endif; ?>
    
    

    Regards
    Brajesh

You must be logged in to reply to this topic.

This topic is: not resolved