Adding shortcodes to Buddypress header and profile fields.

Hey guys,

I would like to use a plugin that generates shortcodes as output. I want this shortcode copy-pasted in the header of a members profile just next or below the avatar and in a profile field. Currently profile fields doesn't accept shortcodes.

Is there a way / plugin where you can drop this shortcode in member-header.php and profile-fields and make it work?

ThX!

  • Jude

    Hey there @Kookidooki

    Hope you are doing great :slight_smile:

    Do you already have the shortcodes with you ?

    You can add / inject them to the profile pages using the snippet given below. You can use it standalone without any plugin in your functions.php file for a one off use.

    add_action( 'bp_profile_header_meta', 'display_my_shortcode' );
    function display_my_shortcode() {
         //This is where the code to display the user data will go.
            do_shortcode('[shortcode] Do something here [/shortcode]");
    }

    Cheers
    Jude

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.