When someone register to my site, they must fill this field (as user meta data) :

  • Name : A
  • Country: B
  • Region: C

so.. when I or other author was log in , I need a link that will display all post from the people who have same country & region with me .. how I can do that?

P.S : I build my registration form with "ultimate member" plug in

1 Answer 1


Unfortunately I don't have time to write the code, but here's what you need to do essentially:

  • Get the current author ID
  • Get the country-field for that user ID. Save this in a $variable.
  • In the loop, before the HTML output code, get the author ID and then get the country-field for that user ID. Store this in $variable2.
  • Then, wrap the HTML output code in an if-statement where you check if $variable === $variable2.

That is essentially how you do it. If no one else has later on, I will write some code for you, but right now I don't have time.

  • @awangfaisal So do I need to write the code or not? Commented Dec 20, 2016 at 7:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.