I am trying to:
Even if the user is different, the user ID value is the same.
If I edit the page, the User ID value changes, and the value comes out the same even if the user is different.
The page URL is
hidden link
I made a staging site. URL is
hidden link
Link to a page where the issue can be seen:
https://toolset.com/forums/topic/the-user-id-does-not-change-in-view-block/
If it is not a view block, it works normally.
hidden link
Minesh
Supporter
Languages:
English (English )
Timezone:
Asia/Kolkata (GMT+05:30)
Hello. Thank you for contacting the Toolset support.
I would like to know that what user ID you would like to display and with what field?
Do you want to display the post author ID or current loggedin user ID?
I want to show login user id.
The code to use is [wpv-current-user info="id"].
It appears normally on the normal screen.
hidden link
However, in the view, it comes out abnormally.
hidden link
Both use the same code [wpv-current-user info="id"].
Minesh
Supporter
Languages:
English (English )
Timezone:
Asia/Kolkata (GMT+05:30)
The shortcode [wpv-current-user info="id"] will return the user ID when you are logged in.
If you will visit the page as non-loggedin (guest) user it will not return user ID as user is not logged in.
When I loggedin using the access details you shared I can see the user ID is 12:
- hidden link
Please check the following screenshot: hidden link
Do you mean you want to display the ID of post author? or what ID you want to show when user is not logged in?
I guess the explanation was insufficient. I will explain by attaching a video.
hidden link
1. Log in with ID: test. user-ID is "5"
At this time, "5" appears in both general and view block.
2. Log in with ID:test1, The user ID is "11".
At this time, "11" appears in general,
View shows "5".
I don't know why, but it seems that View remembers the first logged in user-ID: 5.
After that, even if I log in with a different ID, it shows as "5". In some cases, you may see a different number than the user ID you logged in with.
And this phenomenon only appears in View.
If I modify the View, it looks normal without the above phenomenon. Sometimes it even appears.
Minesh
Supporter
Languages:
English (English )
Timezone:
Asia/Kolkata (GMT+05:30)
What if you disable the caching of your view?
Please check the following screenshot: hidden link
If that does not help - I will require admin access details to your site where I can see the issue with the access details of test and test1 user.
My issue is resolved now. Thank you!
It was a simple matter,
I made a mistake.
Thank you and sorry.