Skip Navigation

[Resolved] Display paginated view depanding on username or user ID

This support ticket is created 6 years, 6 months 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.

Sun Mon Tue Wed Thu Fri Sat
- 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 -
- 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 -

Supporter timezone: Europe/London (GMT+00:00)

This topic contains 1 reply, has 2 voices.

Last updated by Nigel 6 years, 6 months ago.

Assisted by: Nigel.

Author
Posts
#902748

Tell us what you are trying to do?

I made a post type called Wiadomosci

and added group of fields (odbiorca, email, etc.)

I have created form with this fields

Now i want to:

- display view depanding on this scheme:
user ID or username must be equal to odbiorca (odbiorca isn't a post author but he must see posts that he is set as odbiorca)

What is the link to your site?

#902965

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Hi there

I think you need to choose between user ID or username.

You can add a Query Filter to your View that specifies that the field for the user ID or username is set by a shortcode attribute.

Then when you insert the View on a page set the corresponding shortcode attribute using the wpv-user shortcode (specifying whether you want to output the ID or the username): https://toolset.com/documentation/user-guides/views-shortcodes/#wpv-user

You can read about passing values to Views with shortcode attributes here: https://toolset.com/documentation/user-guides/passing-arguments-to-views/

If you have problems let me know and I'll help, but please specify whether your custom field stores the user ID or username.