• Resolved Eileen Valedz

    (@wpgurutech)


    Hi

    i try to show single member profile with following code
    [um_embed_profile user_id=”memberid”] but its not working its shown the shortcode as it is on the page, while the directory funtion working fine, to show the directory, single member not working

Viewing 8 replies - 1 through 8 (of 8 total)
  • missveronica

    (@missveronicatv)

    @wpgurutech

    Have you tried this code snippet for this shortcode with both user_id and form_id?

    https://docs.ultimatemember.com/article/1628-display-specific-profile-with-shortcode

    Thread Starter Eileen Valedz

    (@wpgurutech)

    yes its also didn’t work, see attached screenshot please

    https://ibb.co/5gXXQ8pq

    missveronica

    (@missveronicatv)

    @wpgurutech

    How did you install the code snippet?

    You install the code snippet by adding it
    to your active theme’s functions.php file
    or use the “Code Snippets” Plugin

    https://wordpress.org/plugins/code-snippets/

    Thread Starter Eileen Valedz

    (@wpgurutech)

    i didn’t install any code snippets, should have to install it? if yes by fucntions.php how to do it?

    missveronica

    (@missveronicatv)

    @wpgurutech

    Try to install the “Code Snippets” plugin and copy the UM code snippet
    and paste it to the PHP section in the plugin.

    Thread Starter Eileen Valedz

    (@wpgurutech)

    can you write here the snippet which should be included to display individual user profile?

    missveronica

    (@missveronicatv)

    @wpgurutech

    UM code snippet for shortcode [um_embed_profile user_id="123" form_id="3"]

    add_shortcode("um_embed_profile","um_082321_embed_specific_profile");
    function um_082321_embed_specific_profile( $atts ){
    
        $atts = shortcode_atts( array(
            'user_id' => get_current_user_id(),
            'form_id' => 0,
        ), $atts );
       extract( $atts );
    
        UM()->user()->target_id = $user_id;
        $value = "[ultimatemember form_id='{$form_id}']";
        if ( version_compare( get_bloginfo('version'),'5.4', '<' ) ) {
            return do_shortcode( $value );
        } else {
            return apply_shortcodes( $value );
        }
    }
    Plugin Support Yurii

    (@yuriinalivaiko)

    Hi @wpgurutech

    This thread has been inactive for a while so we’re going to go ahead and mark it Resolved.

    Please feel free to re-open this thread if any other questions come up and we’d be happy to help. 🙂

    Regards

Viewing 8 replies - 1 through 8 (of 8 total)

The topic ‘shortcode not working’ is closed to new replies.