Skip Navigation

[Resolved] Display Post author meta inside conditional shortcode with Elementor template

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

Problem:
Display Post author meta inside conditional shortcode with Elementor template builder

Solution:
To display the post author meta information inside Toolset conditional shortcode, you will have to create a content template using Toolset from Toolset => Content Templates and add conditional shortcode with all required information you want to display inside the conditional shortcode and save your content template.

Then display the content template inside your elementor builder using the shortcode module:

[wpv-post-body view_template="ct-to-display-author-info"]

You can find proposed solution in this case with the following reply:
https://toolset.com/forums/topic/post-author-meta-inside-conditional/#post-2319401

Relevant Documentation:
=> https://toolset.com/documentation/legacy-features/views-plugin/checking-fields-and-other-elements-for-emptynon-empty-values/

This support ticket is created 2 years, 9 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 11 replies, has 2 voices.

Last updated by matthieuB-5 2 years, 9 months ago.

Assisted by: Minesh.

Author
Posts
#2318931

Hi

Im trying to show an author meta field conditionally inside a CPT.
im using this code: (this works with just text but not with the wpv-post-author.

[wpv-conditional if="( $(wpcf-edit-application-status) gte '2' )"]
[wpv-post-author format='meta' meta='user_email' ]
[/wpv-conditional]

Can you show me how to view this data?
+ There is a user connected via relationships to the CPT aswell, i need to show a user field here aswell. (email field)

Thank you!

#2319053

Minesh
Supporter

Languages: English (English )

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

Hello. Thank you for contacting the Toolset support.

I would like to know first which post author field you want to display? the current post author?

Can you please share problem URL where you want to display post author and also mentioned which post author information you want to display?

*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.

I have set the next reply to private which means only you and I have access to it.

#2319285

Minesh
Supporter

Languages: English (English )

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

The admin username and password you shared is not working at this end. Can you please send me working admin access details.

I have set the next reply to private which means only you and I have access to it.

#2319309

the credentials work now
sorry had to manually verify the account

thank you!

#2319321

Minesh
Supporter

Languages: English (English )

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

I'm no this elementor template:
- hidden link

I do not able to locate where you added the following code you shared with your first reply:

[wpv-conditional if="( $(wpcf-edit-application-status) gte '2' )"]
[wpv-post-author format='meta' meta='user_email' ]
[/wpv-conditional]

Can you please tell me where you added the above code?

#2319329

In the bottom section called : show contact information here when accepted
in the left column you can find the shortcode

#2319365

Minesh
Supporter

Languages: English (English )

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

I do not find any content within the column added to the section: " show contact information here when accepted"
Please check the screenshot: hidden link

#2319367

Minesh
Supporter

Languages: English (English )

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

Ok - I found it when I refresh the elementor template. Let me check whats going on.

Can you please share one application single post link with which I should test it.

#2319369
Screenshot 2022-03-17 at 13.48.42.png

yes because the code is not working, it's not showing anything
if i just put text inside of the conditional it works

#2319395

you can test the latests one in applications > first one

#2319401

Minesh
Supporter

Languages: English (English )

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

I've created the following content template using Toolset and moved the conditional shortcode you added to it:
- hidden link

[wpv-conditional if="( $(wpcf-edit-application-status) eq '2' )" ]

[wpv-post-author format="meta" meta="user_email"]
email here

[/wpv-conditional]

- You can adjust the above code as required. I'm not sure why you are using gte (greater then or equal to) comparison with the above conditional shortcode. Instead you should use eq (equal to). I already changed with above shortcode.

Then, on elementor template:
- hidden link

I've added the above content template as given under to shortcode module:

[wpv-post-body view_template="ct-to-display-author-info"]

This is the post where application is completed:
=> hidden link

I can see it does display the email.

#2319415

My issue is resolved now. Thank you!