Skip Navigation

[Closed] How to filter or create a dynamic View with user's CPTs on the user public page?

This support ticket is created 3 years, 3 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
- 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 14:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Jamaica (GMT-05:00)

This topic contains 9 replies, has 2 voices.

Last updated by Shane 3 years, 3 months ago.

Assisted by: Shane.

Author
Posts
#2135661
Author filter.PNG

Hi, support!
I haven't had a problem creating a View which filters CPTs of some logged user on his Account page, but how to display a View with a list of custom posts that belongs only to the registered user (author filter) on his public page?
Those options on 'author query filter' don't work, every option displays all CPTs, not just of the user from some profile page.
I've created a user accounts with UM plugin, but the profile page is a classic WP user page just with UM shortcode, all I want to display on the same page a View below with his CPTs.

URL format is: hidden link

Thanks, Sinisa

#2135717

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Sinisa,

Thank you for getting in touch.

The most suitable option here is to set the view filter to get the author information from the current logged in user.

Would you mind allowing me to have admin access to the site so that I can have a look at the view to see why the options are not working ?

I've enabled the private fields for your next response.

Thanks,
Shane

#2136437

Hi Shane,
I think it is a misunderstanding.
I don't need a View with custom posts of the currently logged user.
I need an option to see in public all customs posts of each registered user on their public pages, not for a user to see his own custom posts when is logged to his account page.
So it should be a relation Custom posts <> Author's public frontend profile page...
Frontend where others users or visitors can see custom posts of some registered user.

The first option on the screenshot ( Post author filter ) is for the logged users but I don't need that (that is already done), I need it for the user's public profile page... I marked yellow what should be an option (sixth option), but I don't know how to connect with the URL.

#2139349

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Sinisa,

I get what you are saying now.

Given that you've selected the URL parameter option, you're going to have to provide the username in the url when you're clicking to their page.

Example the URL would look like this hidden link

Where author-filter is the name of the parameter and username is the ID of the user.

Please let me know if this is clearer for you.
Thanks,
Shane

#2140239
Slika zaslona 2021-08-11 14-21-43.png

Hello Shane,

I've tried to change permalinks type to such format but no effect. (please see image, "Plain" option).. Maybe is reason that is UM plugin I don't know...
There is some similar reports on Toolset support but all of them haven't prompt solution.

I found custom PHP code (snippet) which will put any custom post type under UM profile "Posts#" tab...
So I found a solution out of Toolset.
But still remains question how to filter every author's posts on his public profil page?

#2140321

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Sinisa,

No this is not what im referring to. All you essentially need to do is to pass the user's username into the URL.

Is there a particular page that you are navigating to the user's profile from ? If so then this is where the URL needs to be modified from.

Can you provide a bit more information on the page where you are navigating from to view the user's profile, perhaps I can provide a bit of advise on how you can add the parameter to the URL.

Thanks,
Shane

#2143039

For now this is format of a link of some user's public profile page: hidden link
(partnerio is username)

I can change permalink format in this: hidden link
but no changes, post author filter won't select only posts of that particular user which user page is.

So marked yellow in first screenshot doesn't work for me... (author-filter)
Likely because it is UM plugin created user profile page.

I found snippet of PHP code which adds other custom posts under "Post" tab of UM plugin on profile page, but I want to know how to deal this with Toolset.

#2143849

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Sinisa,

Before we go any further lets test if the view actually works when the url parameter is provided.

Add the view to the profile page then navigate to it with this url author-filter=username

hidden link

Let me know if the view is filtered when the url is provided like that.

Also you can provide me with admin access to the website so that I can assist with this one further for you.

Thanks,
Shane

#2144721
View added filter.PNG
FIlter works with such link.PNG

So your link: hidden link

WORKS!

The view is filtered, it shows custom post ONLY of that author (username:partnerio, nickname: Partnertest)

But If I come on user profile from another side (members archive), then the format of the link is changed and the filter (by author) doesn't work anymore: hidden link

Also if I click on any tab on the profile page (like comments, posts, etc.) a link will be changed (hidden link)

So filtering and View definitely work, but if there is a different permalink format, it won't...

#2144771

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Sinisa,

Great that it works, which is what I was explaining earlier that you need to format the URL to have the parameter.

Are you clicking to the user's profile page from a different page? Lets say you're on one of their posts and you click on their username, it takes you to their profile.

Please let me know and if possible provide admin access to the page that you are clicking from to access the user's profile.

Thanks,
Shane

The topic ‘[Closed] How to filter or create a dynamic View with user's CPTs on the user public page?’ is closed to new replies.