I implemented what was suggested but it doesn't work as I thought it had.
I need to display theresults that belong to the person who is logged in. so for example:
We have a custom post type (not created with toolset) that has posts created by different users. Each one is identified by a client_id#. I want to detect the ID# and only show the posts (in that view) to them when they are logged in. RIght now I have access showing the page on login, I just can't get the condition to filter the posts to only theirs.
Can I get some more info about how the data is set up.
Typically you would have a custom post type and where the posts themselves are related to different users, they would be the authors of the posts, that's how you would know that post A belonged to user 1, etc. In that case it is fairly trivial to show posts belonging to user 1 with a post_author Query Filter.
But from your question it sounds like you are using a custom field client_id to connect the users to posts.
Is the client_id unrelated to the user ID and stored as a custom field on *both* the post and the user?
So that what you need is for user 1 (with client ID ABC123) to be able to see posts which have a client_id custom field value of ABC123?
Yes but these posts are actually being generated via an API on a different server so the mapping has to be done by the user's UID. Thus we have assigned a custom field to serve this purpose.
We need user1, joe@test.com, with uid of 123 to only see posts in CPT XXXX with his UID in the custom field of CLientID.
The first is that you create a View to display the custom posts, and you include a Query Filter for the client_id field (not sure exactly what you have called it), where you will pass the value to match via a shortcode attribute (see screenshot).
Then when we insert that View on a page we provide a value to that attribute that comes from the custom user field, so your shortcode would look something like this:
The wpv-user shortcode doesn't specify a user ID and so the currently logged-in user is the source. So whoever visits the page where this View is shown will see their posts.
I tried to log in to your site but the credentials you provided don't work.
Double-check the name of the user field which stores the client ID (I based my example on an earlier reply of yours, but you should confirm that the field has a slug of 'custom-user-client_id', which means it is stored with a key including Types prefix of 'wpcf-custom-user-client_id').
And make sure the shortcode attribute specified in the Query Filter ('clientid' in my example) is the same as that you add to the wpv-view shortcode.
I'll set a private reply in case you want to update credentials.
Although you added a Query Filter to the View where the value comes from a shortcode attribute clientid, you didn't do the second part, which is to actually supply the value where you insert the View.
I had to install a plugin to inspect the database to find the correct key for the client id user field, which appears to be ref_cdmv_client_id.
So where you insert the View you need to provide the value for the clientid shortcode attribute, like so:
(The curly brace format is because you are inserting the shortcode in a Divi module.)
So when a user visits the page, their client_id (coming from the field ref_cdmv_client_id) will be passed to the View, and is used as the value the Query Filter compares to the client_id field of the posts.
The next problem is the output of your View.
In the template the contents are wrapped in a conditional shortcode. I'm guessing this was your first attempt at trying to only output results where the client_ids matched, but it failed because you compare wpv-user without specifying which user field you want to compare. In any case it should be redundant because of the above set up, and should be removed.
(I added the post title outside of this conditional just to confirm that the expected posts were being returned by the View, which appears to be the case.)
So how do I apply this cnditional to the view so it appears as the list? It appears to be avoiding all those <td>...</td>'s in the template. Does the conditional statement belong in the loop instead?
Sorry, I can't see your screenshot, we have a bug on our system that won't accept screenshots where the filetype (PNG) is in caps.
Could you re-post as a .png?
Also, can you explain what the conditional shortcode is for?
Right now, you should have working the Query Filter which means that the View is only returning the correct posts, those where the client_id on the post matches that for the current user.