0

I am looking to see if it's possible to assign posts to specific logged in users? For example: Example: John Smith (member) logins into my site, and he can only see posts that have been assigned to him.

I have seen the Members plugin called Members but not sure it that plugin can handle my requirements.

Thanks

1 Answers1

0

Here's one way to do it, not the most dynamic as you'd need a category for each user but it might suit you if you only have a small number of users.

You could create categories one for each user then use a custom loop to only show categories for that user.

So something like

if($user == 'John Smith'){
    $taxTerm = 'John Smith CatTerm'
}

Then create a custom loop using WP_Query (https://codex.wordpress.org/Class_Reference/WP_Query) and use $taxTerm in your tax_query

Paul
  • 1,412
  • 1
  • 9
  • 19