Skip Navigation

[Resolved] Adding a related Custom Field (AUTHOR) to an Elementor Pro Page Template

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
- 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 10 replies, has 2 voices.

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

Assisted by: Luo Yang.

Author
Posts
#1294597

Please see this 2min video to explain the issue fully.

hidden link

Custom Type - Productions

is related to

Custom Type - Author

I want to display the author's name on a 'Productions' page template from Elementor Pro

#1294629
#1294645

Hi,

Thanks for the details, I can log into your website, will update here if there is any found.

#1294679

Since you are using many-to-many relationship between post types "Productions" and "Authors", so:
1) one "Productions" can connect with multiple "Authors" posts,
2) in a single "Productions" post, you can setup a post view:
- Query "Authors" posts
- filter by post type relationship between "Productions" and "Authors"
- and display "Authors" post information

See our document:
https://toolset.com/documentation/post-relationships/how-to-display-related-posts-with-toolset/#displaying-many-related-items
section "Displaying many related items"

#1294693

I will look at this again Luo as I have tried to work out what this document says, thanks for your help...I think this may be outside my ability...I'll get back to soon.

#1294703

It should be very easy to setup the post view, please let me know if you need assistance for it, I can setup a demo in your website.

#1294729

If you could Luo that would be great but please don't spend too much time on it.

Without 'relationships', adding custom field was really, really easy...but my brain hurts with relationships!

Thank you Luo

#1294775

I have done below modifications in your website:
1) Create a post view "related Authors posts":
hidden link

- Filter by:
Select posts in a Productions - Authors relationship that are related to the Post where this View is shown.

- in view's loop, display below Authors post title:
[wpv-post-title]

2) Edit your template:
hidden link
display the above post view's shortcode:
By [wpv-view name="related-authors-posts"]

Test it in front-end with a single "Productions" post, for example:
hidden link

It works fine. it is only an example, you will need to customize it with CSS and HTML codes.

#1295257

Hi Luo

How do I add the 'directors credit' field from the 'Productions' custom type, to this view? At the moment it is added in Elementor Template but that then moves the author name to the next line. It would be good to be able to add this Author Credit in the view then I can style that from there?

I must admit, although I can see what you have done, I don't really understand how it works. 🙁

#1295375

The custom field "author-credit" is setup in Production post type, so shortcode [types field='author-credit'][/types] won't work in "Authors" posts loop.

I have done below modifications in your website:
Edit the post view "Production - AUTHORS":
hidden link

1) in section "Loop Editor", remove the shortcode [types field='author-credit'][/types]

2) in section "Loop item in Productions - AUTHORS", remove the shortcode [types field='author-credit'][/types], and add "strong" HTML tag, as below:

<strong>[wpv-post-title]</strong>

3) Enable option "Disable the wrapping DIV around the View"
Normally, the View has a wrapper DIV which includes IDs and classes required for AJAX updates and pagination. If you want to show the View inline with text, you can disable this DIV

Please test again, check if it is what you want. thanks

#1295539

Luo that is great...I've had a look through that and 'think' I understand.

The only thing I need to do with this line is NOT display it at all if there is NO Author credit. This is something to do with an IF statement I think but again I don't know what and where to put it - in the View, in Elementor?

As you can see Luo I am very new to doing this, loads to learn, and really do appreciate your help. Are you available to hire? 🙂

Thanks

John

#1295547

I assume the original question of this thread is resolved, for the new questions:
I need to do with this line is NOT display it at all if there is NO Author credit
Please check the new thread here:
https://toolset.com/forums/topic/i-need-to-do-with-this-line-is-not-display-it-at-all-if-there-is-no-author-credit/