I have 3 CPT and i would like to know if it is possible to list them on the registered user profile/author page.
I want that 'not registered users' AND 'registered user' can see other users created CPT. on theirs profile page listed by each CPT under its title <h3>.
I found this thread from 2014, but don't know if feature is still not available https://toolset.com/forums/topic/author-archives-that-list-custom-post-types/
Thanks.
Dear augusto,
What is the user profile/author page?
The thread you mentioned above:
https://toolset.com/forums/topic/author-archives-that-list-custom-post-types/
Which is a author archive page, this feature is still unavailable, Views can not modify the query of archive page, can only format the output, see our document:
https://toolset.com/documentation/user-guides/normal-vs-archive-views/
In your case, I suggest you create a wordpress page to replace the author archive page, in this page, create three views, use each view to list posts of post types
Hope it help
Thanks for the reply luoy
For user profile/author page I mean the author page for each WordPress user, it's a multiple user website.
I assume we are talking about author archive page, as I mentioned above, Views can not modify the query of archive page, you will need to create a wordpress page to replace the author archive page:
create three views, use each view to list posts of post types
for example, there three custom post types in your website:
CPT1, CPT2, CPT3,
1) You can setup three views to list posts of each custom post type, filter with Post author is set by URL parameter "author_id":
https://toolset.com/documentation/user-guides/filtering-views-query-by-author/
section "Post author is set by URL parameter"
2) Then put all three view into a page
3) then setup links to pass author IDS to above page, like this:
/page/?author_id=13
So i have to create urls that show username linked to this special page with the same user on the url /page/?author_id=13 OR /page/nickname.
Will I be able to create custom links of CPT authors in listings and CPT views?
Yes, it is very easy to setup such kind of link with Views shortcode [wpv-post-author], for example:
You can use below shortcode to get the author ID of current post:
[wpv-post-author format="meta" meta="ID"]
More help:
https://toolset.com/documentation/views-shortcodes/#wpv-post-author
Display details for the author of the current post.
Will that work on a listing loop?
For example, you are using a page to display all three views, the page ID is 123, then in the view's loops, you can setup author link to the page 123, as below:
<a href='[wpv-post-url id="123"]?author_id=[wpv-post-author format="meta" meta="ID"]'>[wpv-post-author format="meta" meta="display_name"]</a>
More help:
https://toolset.com/documentation/views-shortcodes/#wpv-post-url
https://toolset.com/documentation/views-shortcodes/#wpv-post-author
Perfect, thanks for the support.