Skip Navigation

[Resolved] How to connect View with current author info to the post

This thread is resolved. Here is a description of the problem and solution.

Problem:

I want to display information about author of this current post.

Solution:

In a single post, you can get the post's author ID with shortcode:
[wpv-post-author format="meta" meta="ID"]

Then pass it as attribute of view, you can get the corresponding user information.

Relevant Documentation:

https://toolset.com/documentation/user-guides/views-shortcodes/#wpv-post-author

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

Supporter timezone: Asia/Hong_Kong (GMT+08:00)

This topic contains 3 replies, has 2 voices.

Last updated by Luo Yang 6 years, 4 months ago.

Assisted by: Luo Yang.

Author
Posts
#1084814

For example, I have the post hidden link

At the top of the post i want to display information about author of this current post.

1) I created a View with necessary fields and html/css styling - hidden link.
2) And paste shortcode at the post template - hidden link

As a result i got list with all users - hidden link but my goal is View just with author of this current post.

So I dont know what a filter settings i need. Please help me find decision.

#1085465

Hello,

In a single post, you can get the post's author ID with shortcode:
[wpv-post-author format="meta" meta="ID"]
https://toolset.com/documentation/user-guides/views-shortcodes/#wpv-post-author

Then pass it as attribute of view, you can get the corresponding user information, for example:
1) Edit the view "single - Дом - Информация о владельце объекта", add a filter:
Select users with id set by the View shortcode attribute "users" and with role "(any)"
eg. [wpv-view name="view-name" users="1"]

2) Edit the layout "Дома", display above view using below shortcode:

[wpv-view name="single-dom-informatsiya-o-vladeltse-obekta" users='[wpv-post-author format="meta" meta="ID"]']

Then test again

#1085553

thanks

#1087320

You are welcome