Adding specific member content to pages/content?

I would like to be able to have registered members be able to input and update some personal and private content while logged in, and then that to be able to be displayed in various places on the website. I don't want to custom design this as it isn't a key feature and I don't want the ongoing challenge of supporting it, but I am wondering if there is a plugin or way to do this.

One thought I had was adding private profile fields (only viewable by them), but other than going back to their profile is there a shortcode or some simple php (that won't easily break with theme and wordpress updates) that I could add on a page to display that data?

Or is there another plugin that could do something like this? It won't be a lot of content, but I could see using this for 5-10 things that could be as long as a paragraph or so each.

Thanks! David

  • David

    So maybe I wasn't clear, or if this does solve the problem great. Here would be a basic example. Let's say I have 5 goals I want to accomplish. I could tell the user when logged in to go to their profile (or another place if not using that) and put in their five goals.

    Then in content they access later, such as a training video, I could then call up that specific data they entered and, for example, put in a sidebar so they can see the goals they set.

    If I understand your response correctly the role and content would be the same for all members (at least of that role). But I want that content to be only theirs and no one else can see unless they give them access to their account.

    The only easy way I can think to make this work is by having a private profile field, but not sure how to call only that specific field back up for that user in other content.

    Or are you saying protected content can do this? I am open to using that - I was planning on using the membership plugin for everything, as I would prefer to pick one solution, but I could probably switch to protected content for all of it if I can use that to give this functionality.

    Thanks! David

  • calvinrogercanas

    Hi @David,

    Thanks for your reply.

    You could use the xprofile function comes from BuddyPress when you install it(you can use it without using buddypress).

    To add new custom profile fields go to Admin -> Users -> Profile Fields -> Then click on "Add New Field"

    then add this code to the template you want to show the goals - they are the only one who can see it because you need to be logged-in to see this.

    <?php
    $user_id = get_current_user_id();
    if ($user_id !== 0) {
    	echo xprofile_get_field_data('YOUR FIELD NAME REPLACE THIS', $user_id);
    }
    
    ?>

    Change the "YOUR FIELD NAME REPLACE THIS" to the name you assigned to your field.

    Let me know if it helps! :slight_smile:

    Best Regards,
    Calvin

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.