Skip to:
Content
Pages
Categories
Search
Top
Bottom

Change avatar button on profile page

  • @stef78

    Participant

    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!

Viewing 6 replies - 1 through 6 (of 6 total)
  • @nuprn1

    Participant

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

    @stef78

    Participant

    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?

    @nuprn1

    Participant

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

    @stef78

    Participant

    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?

    @nuprn1

    Participant

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

    @stef78

    Participant

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

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Change avatar button on profile page’ is closed to new replies.
Skip to toolbar