Is there a way to add a link on user profiles of posts related to user?

Ok, this is a tricky question with probably too complicated an answer -- but I've been amazed at the solutions I've gotten here, so here goes....

First, the specifics:
* I'm about to import hundreds of users from an old site into a new Wordpress one.
* The new site has cool-looking user profiles courtesy of Ultimate Member, and you can build the profile with fields that you can place anywhere you like.
* I already imported a bunch of posts/articles that mention these users, many of which have corresponding tags that match these user's display name. (So an article that talks about "John Smith" will also have a "John Smith" tag or "john-smith" tag slug associated with it).

Now....I would like to add a content box on the default Ultimate Member profile form that has links to the posts/articles that mention the user of whatever profile you're viewing. I'm not quite sure how to do this, however.
I know there are ways to call a user's ID, I believe, but not sure how to get this to correlate to posts that mention said user (I don't want posts WRITTEN by the user, which Ultimate Member can already do).

A user's profile URL would be something like "www.mysite.com/profile/john-smith", while a tag slug related to them is also "john-smith" -- but is there a way to write some code that could be placed in a content box on profiles that would dynamically display a list of posts related to that user only?

A displayed list of posts is preferred, but I'm ok with a link that takes you to a post-search for the tag slug that relates to them as well. As long as there's SOME way to access posts related to the user who's profile you're visiting...

Is this possible?? I'm sure it is, so the question is...how easy could this be? It's for a non-profit site (so can't really spend money on custom development), and it's also due very soon (so on tight schedule).

Any help, suggestions, leads, etc. would be greatly appreciated -- thanks!!

  • Michael Bissett

    Hey @Anton, Michael here!

    Just being upfront here, this would be something that'd require more than a simple tweak, and would be something that'd require the assistance of a developer (the budget & time limitations taken into account as I say this).

    From what I can tell, the first thing to consider would be, what hooks does Ultimate Member offer? You're looking to hook into the profile here, and knowing how that could be done first would be essential (even practicing a simple echo statement saying "Hello world!" would do, the key is, can content be displayed there?).

    Having said content area refer to the user... hmm. That's where the custom development really comes into play, I would think that you might want to look to BuddyPress for inspiration on that one, though, specifically the Activity feed functionality.

    For what it's worth, I hope this helps! :slight_smile:

    Kind Regards,
    Michael

  • Anton

    @Michael Bissett -

    Just being upfront here, this would be something that'd require more than a simple tweak, and would be something that'd require the assistance of a developer (the budget & time limitations taken into account as I say this).

    Understood.
    I've seen things that I thought would be super simple end up being really, really complicated. At the same time, I've also seen things that I thought would require a crazy amount of development work end up having a super simple 5-minute solution. Since I never know how it will go, I figure it never hurts to ask... :wink:

    From what I can tell, the first thing to consider would be, what hooks does Ultimate Member offer? You're looking to hook into the profile here, and knowing how that could be done first would be essential (even practicing a simple echo statement saying "Hello world!" would do, the key is, can content be displayed there?).

    I believe Ultimate Member has lots of hooks, but I'm uncertain how to use most of them yet.
    Here's how to get a user's display name, for example: http://docs.ultimatemember.com/article/127-umgetdisplayname
    Though what to do with that info, and how to use it for my purpose, I have no idea.
    There's more UM documentation here: http://docs.ultimatemember.com/collection/28-for-developers

    The customizable profile forms have a "Content Block" option where you can add anything via a WYSIWYG editor. There's also a way to add a shortcode function anywhere. I'm assuming one of these is needed to ultimately display the posts that mention users that I need.

    Having said content area refer to the user... hmm. That's where the custom development really comes into play, I would think that you might want to look to BuddyPress for inspiration on that one, though, specifically the Activity feed functionality.

    I'm not using BuddyPress because Ultimate Member has what I need (including an Activity feed). It supports hashtags (but not "@" mentions). Even if it did, I'm not sure how that would connect with tag slugs in posts.

    I know this is probably not going to work without tons of development time and money (neither of which I have at the moment), but figured I'd throw this out there in case someone had come up with a solution for something similar and wanted to share, or simply saw this as an interesting challenge. I would see it as a fun challenge myself, if I just had a little more coding experience/understanding of how Wordpress works. But I'm getting there...

  • Michael Bissett

    Hey @Anton,

    No problem, I know what you mean about how complex something can seem, thanks for asking! :slight_smile:

    Just to touch on this briefly:

    I'm not using BuddyPress because Ultimate Member has what I need (including an Activity feed). It supports hashtags (but not "@" mentions). Even if it did, I'm not sure how that would connect with tag slugs in posts.

    I had the inkling I should've elaborated earlier, what I meant to say was to look to BuddyPress's code for inspiration on this, to try to get an idea on how to track the tagging of a user.

    All the same though, this would be something that'd require a good deal of work to implement. :slight_smile:

    Hope you're doing well this evening, and thanks again for your question Anton!

    Kind Regards,
    Michael

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.