Skip Navigation

[Closed] Conditional comparing current user meta to author meta

This support ticket is created 8 years, 1 month ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- - 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00
- - - - - - -

Supporter timezone: Asia/Ho_Chi_Minh (GMT+07:00)

Tagged: 

This topic contains 1 reply, has 2 voices.

Last updated by Beda 8 years, 1 month ago.

Assisted by: Beda.

Author
Posts
#374565

I am trying to use a view with a conditional, and I only want to select the posts where the current users 'location' (user field) is equal to the author of the posts 'location'.

Nothing is coming up in the view and I suspect it is the conditional causing the problem. Have I referred to the author's location incorrectly?

[wpv-conditional if="('[types usermeta="location"][/types]' eq [wpv-post-author format="meta" meta="location"])"]
#374575

1. Select the posts where the current users 'location' (user field) is equal to the author of the posts 'location'.

So how do you populate the User Meta Field 'location' with the author of the posts 'location'?

What is User Meta Field 'location' holding? (user_id or something else?)

2. According to above info we can craft a code.

As tip, use the "conditional Output" button, and create the condition.

Then, insert the Meta Fields with the Fields and Views Button and change the double apostrophes to single ones, if the ShortCode has some.

Thank you for your patience.

The topic ‘[Closed] Conditional comparing current user meta to author meta’ is closed to new replies.