How do I show the values on front-end?

I am building a member-based site, where the members come and register on the site, which is frequented by their possible clients. To build profiles of the members, we have used a front-end form, which the members are required to fill. Their filled-up form's answers are displayed at the back-end of the Wordpress, and the admin can see that. Now we are taking those answers are building the members' profiles by copy-pasting the answers from the back-end to the new posts. My problem is this: I want to make sure that the answers get copied to a new post by themselves (a draft post is then made automatically), which we can later review and publish.

Kindly advice what to do to make this happen. I am not a very technical person, and that is the reason I bought WPMUDEV package so that I get appropriate guidance from you.

  • aristath

    Hello there @Cosmos, I hope you're well today!

    To build profiles of the members, we have used a front-end form, which the members are required to fill. Their filled-up form's answers are displayed at the back-end of the Wordpress, and the admin can see that.

    Does the plugin you use for this create the data a a new custom post type that is somehow linked to the user?
    Or does it simply add user meta in the WordPress database?
    If it's the latter then you could use the get_user_meta function to retrieve that data: http://codex.wordpress.org/Function_Reference/get_user_meta

    Now we are taking those answers are building the members' profiles by copy-pasting the answers from the back-end to the new posts.

    If the data is stored as usermeta, then this process is completely redundant...

    Why don't you simply use BuddyPress?
    If you don't need all the social stuff that it has, then you can simply enable profiles and the rest won't be loaded!
    You can then add your custom profile fields in their profiles and they can sutomatically edit their info, correct it, and it will also be searchable if you choose so.

    I hope that helps!

    Cheers,
    Ari.

  • Cosmos

    Hi Ari,

    Thanks so much for your prompt reply. Because I just joined WPMUDEV, I missed your response and could only see it now. All this while I was like, "Why haven't they got back to me?" Silly me.

    Anyway, you wrote: "If the data is stored as usermeta, then this process is completely redundant..." Yes, the filled-in data is stored in the usemeta. We just have to make the data appear in a post now.

    No, it does not "create the data a a new custom post type that is somehow linked to the user".

    I am very interested in your idea of using BuddyPress. But I had tried it before and it let me down. I think it requires that I use one of the BuddyPress-compatible themes, and we already have set up our chosen themes and worked a lot on that. Plus, any of the themes that BuddyPress threw at me, I could not pick one that suited my purposes. So if you could please guide me on how to get around this requirement of BuddyPress to use their own theme, I'll be so thankful to you.

    Again, your getting back to me in an hour's time was much appreciated. Good on you!

  • aristath

    Hello again @Cosmos,

    BuddyPress in its latest releases has no requirements from your theme, so if you install version 1.9 you shouldn't have to change anything!
    Could you also post a link to your website so that I may see the theme you're using?

    We just have to make the data appear in a post now.

    Posts are not recommended for that... If you want to show the usermeta on a post, you'd basically have to create a new template file for that post in your theme (you can find out what name you'll have to use for that template file here: http://codex.wordpress.org/Template_Hierarchy#Single_Post_display ) and then use something like this in the template file:

    <?php
    
    // get the current user ID
    $user_id = get_current_user_id();
    
    // Echo the metadata stored for the current user
    // Replace 'user_meta_key' with the metadata key
    // That you actually want to display.
    
    // For example to display their lastname
    // you'd replace 'user_meta_key' with 'last_name'.
    echo get_user_meta( $user_id, 'user_meta_key', true );

    I added some comments in there too so it's simpler to get you started.

    I hope that helps!

    Cheers,
    Ari.

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.