Group Mods

  • Profile picture of @mercime
  • Profile picture of r-a-y
  • Profile picture of Hugo

Change avatar button on profile page (7 posts)

Started 1 year, 10 months ago by: Stef

  • Profile picture of Stef Stef said 1 year, 10 months ago:

    Hi,

    I like to add a “Change Avatar” button to the member page, which must only be shown when this user is logged in.
    I’ve made an example in photoshop..

    changeAvatar

    When I past the code.. code in member-header.php
    The link will be visible on any member page.. also when a user views a profilepage of another user.

    So my question:
    I’m searching for a method that this button is only visible for the logged in user on his own page.
    And that the button is the default button of buddypress.. not just a hyperlink.

    Can anybody help me with this?
    Thanks!

  • Profile picture of rich! @ etiviti rich! @ etiviti said 1 year, 10 months ago:

    use the core-templatetag bp_is_my_profile() in a conditional check

  • Profile picture of Stef Stef said 1 year, 10 months ago:

    Thank you for your response.
    But I’m not sure how to do this. My php skills are not quite good.
    Would you please show me how I can use this code?

  • Profile picture of rich! @ etiviti rich! @ etiviti said 1 year, 10 months ago:

    <?php if ( bp_is_my_profile( ) ) { ?> your link code here <?php } ?>

  • Profile picture of Stef Stef said 1 year, 10 months ago:

    Ok.. this is what I got..
    code
    And it works..

    Only .. how can a set that link to the default button of buddypress.. Like the screenshot above?

  • Profile picture of rich! @ etiviti rich! @ etiviti said 1 year, 10 months ago:

    as for the button code – just wrap it in a div with the class generic-button

  • Profile picture of Stef Stef said 1 year, 10 months ago:

    ah.. ok.
    thanks.. I’ve got it working now!