Skip Navigation

[Resolved] display usermeta belongs to parent post author

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

Problem:
display usermeta belongs to parent post author

Solution:
To display the custom user fields - you can use the shortcode:

[types usermeta='ragione-sociale' user_id='[wpv-post-author format="meta" meta="ID" item="@your-relationship-slug.parent"]'][/types]

You can find the proposed solution, in this case, with the following reply:
https://toolset.com/forums/topic/display-usermeta-of-parent-post-relationship/#post-1170506

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

This support ticket is created 5 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
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10: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/Kolkata (GMT+05:30)

This topic contains 5 replies, has 2 voices.

Last updated by domenicoS 5 years, 4 months ago.

Assisted by: Minesh.

Author
Posts
#1170405

Hi

I've a view where I display info about POST 1.

There is a relationship between POST 1 (parent) and POST 2(child).

In the POST 1 I have an AUTHOR 1
In the POST 2 I have an AUTHOR 2

In the view of POST 1 I display the title of POST 2 with this:

[wpv-post-title item='@accommodations-product.parent']

How can also display the meta of the author of POST 2? Like the email for example..

#1170439

For more info:
- the relationship slug is "accommodations-product" and the parent slug is "accommodations"

I tried with this:

[types usermeta='ragione-sociale' id="$accommodations"][/types]

But does not work, the result is empty.

#1170471

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

Well - to display the post author meta information you should try to use the following shortcode:

For example - to display parent post author nickname:

[wpv-post-author format="meta" meta="nickname" item="@accommodations-product.parent"]

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

#1170492

Hi Minesh, thank you.
It works with nickname, but not with my user custom fields. I tried for example this:

[wpv-post-author format="meta" meta="ragione-sociale" item="@accommodations-product.parent"]
#1170506

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Ok - so the custom user fields are a different thing here.

To display the custom user fields - you can use the shortcode:

[types usermeta='ragione-sociale' user_id='[wpv-post-author format="meta" meta="ID" item="@accommodations-product.parent"]'][/types]

Does above shortcode works?

#1170710

It's perfect! Thank you Minesh!

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.