Skip Navigation

[Résolu] display usermeta belongs to parent post author

Ce fil est résolu. Voici une description du problème et la solution proposée.

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 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.

Marqué : ,

This topic contains 5 réponses, has 2 voix.

Last updated by domenicoS Il y a 2 années et 7 mois.

Assigned support staff: Minesh.

Auteur
Publications
#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: Anglais (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: Anglais (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!