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
Hi,
Thanks for the details, I can log into your website, will update here if there is any found.
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"
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.
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.
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
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.
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. 🙁
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
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
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/