BuddyDev

Search

add a button (shortcode) to user’s profile in buddypress

  • Participant
    Level: Initiated
    Posts: 7
    Amanda on #47349

    Hi, is it possible to add a custom button in the user’s profile? I would like to add a shortcode that displays a “tip the author” shortcode. Is this possible? I am pretty new with this so any help would be appreciated. It is shortcode, not html. Thanks

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 2505
    Ravi on #47358

    Hello Amanda,

    Try the following code:

    
    add_action( 'bp_before_member_header_meta', function () {
    	echo do_shortcode('[your shortcode goes here]');
    } );
    
    

    Please let me know if it works or not.

    Regards
    Ravi

  • Participant
    Level: Initiated
    Posts: 7
    Amanda on #47366

    Hi, thanks. Just to confirm, where does this code go? In functions or?

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 2505
    Ravi on #47369

    Hello Amanda,

    you can place this code under the active theme ‘functions.php’ file or ‘bp-custom.php’.

    For more info on the bp-custom file please refer to the following link:
    https://buddydev.com/docs/buddypress-guides/what-is-bp-custom-php/

    Regards
    Ravi

You must be logged in to reply to this topic.

This topic is: not resolved