This topic has 3 replies, 3 voices, and was last updated 9 years by ianll.

  • Author
  • #45154
     Kookidooki
    Participant

    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!

    #45156
     sharmstr
    Moderator

    Try this in your functions.php file

    COPY CODE
    
    add_action( 'bp_profile_header_meta', 'display_shortcode' );
    function display_shortcode() {
    	echo do_shortcode('[shortcode]');
    } 
    
    

    Change shortcode to the shortcode you want to run.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    This support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com

    #51042
     ianll
    Participant

    Is this what I need to allow user additional profile fields to display shortcode content from sites like soundcloud, youtube, etc? can you show me the code to add multiple providers, youtube, soundcloud, vimeo and the rest of the native supported oembed providers integrated with wordpress core?

    #51046
     ianll
    Participant

    After adding this code and replacing “shortcode” with soundcloud I only show this in the profile header “[soundcloud url=”https://api.soundcloud.com/tracks/178136646″ params=”auto_play=false&hide_related=false&show_comments=true&show_user=true&show_reposts=false&visual=true” width=”100%” height=”450″ iframe=”true” /] View
    [soundcloud]”

Viewing 4 posts - 1 through 4 (of 4 total)

The forum ‘General questions’ is closed to new topics and replies.

Log in with your credentials

Forgot your details?