• Resolved holoholo

    (@holoholo)


    I’m using the shortcode for a profile form on a page.
    https://docs.ultimatemember.com/article/210-ultimate-member-shortcodes
    Says it should work. I also have the profile form shortcodes on the user page.
    However, for one set of users, I want to be able to build and control their pages differently than the rest so I’d like to be able to put the shortcode for their profile on a page.

    Is this possible with user_id as a parameter in the shortcode?

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Contributor Champ Camba

    (@champsupertramp)

    Hi @holoholo

    Unfortunately, it’s not possible and this requires customization on your end. Let’s see if others in the forum have done something similar and share their solution here.

    Regards,

    Thread Starter holoholo

    (@holoholo)

    I have not been able to solve this problem. Can you please give me an overview of how to solve it? It seems like such a basic feature, show a particular profile on a particular page. Can you please help me solve the problem?

    @holoholo

    You can always use a HTML iframe to show profile pages

    <iframe src="https://yourdomain.com/profile/1/" style="border:none;height:2000px;width:100%;" title="Iframe Example"></iframe>

    Thread Starter holoholo

    (@holoholo)

    Thank you, but I want to put the shortcode on a page. The iframe looks weird and then it’s a page on a page so the navigation is all goofy and duplicated. Interesting idea though thanks.

    I really want to build a page and add the shortcode.

    Thread Starter holoholo

    (@holoholo)

    @champsupertramp I have someone who might be able to do it but it sounds like a huge project. I’m still baffled that this isn’t part of the product.

    Can you give us some direction of what he needs to do so he doesn’t waste a ton of time in the wrong direction?

    @holoholo

    You can remove the navigation menu within the iframe
    if the menu is wrapped in a div with an id by using javascript code.

    Plugin Contributor Champ Camba

    (@champsupertramp)

    Hi @holoholo

    You can try this code snippet below:

    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 );
        }
    }

    Add the above code to your theme/child-theme’s function.php file or use the Code Snippets plugin to run the code.

    Once the code is added to your site, you can use the following shortcode to embed a specific profile to a page:
    [um_embed_profile user_id="150" form_id="10"]

    150 – is a user ID.
    10 – is a form ID

    Regards,

    • This reply was modified 10 months, 1 week ago by Champ Camba.
    Plugin Contributor Champ Camba

    (@champsupertramp)

    Hey there!

    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 by changing the Topic Status to ‘Not Resolved’ 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 for profile not working’ is closed to new replies.