Tell us what you are trying to do? I have a custom post called 'issue' and it has a relationshop 'issue-editorspeak' with another custom post 'editorspeak'... I need to create a short code to access the post-url of 'editorspeak' from the issue .. and I am using this .. [types field='post-url' item='@issue-editorspeak.child' output='raw'][/types] .. but it's creating an href to the same page and not to the child post.. This is the main page (issues) enlace oculto and the READ MORE link on the first para (editorspeak) should take the user to this page ..enlace oculto
Is there any documentation that you are following?
Is there a similar example that we can see?
What is the link to your site?enlace oculto
Hello,
How do you setup the relationship "issue-editorspeak"?
If it is one-to-many relationship, then one "issue" post can connect with multiple "editorspeak" posts, so you will need to setup a view to get related "editorspeak" posts, 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"
Hi Luo Yang
My Issue Articles relationshop is one to many.. One Issue can have Many Article
But my Issue Editorspeak is one to one.. One Issue can have only One Editorspeak.
Will check link that you sent to me.. but if the solution is something else then please do let me know.
Regards,
Alim
For one-to-one relationship, in a single "Issue" post, you can display the related "editorspeak" post information directly with Types shortcode as you mentioned above:
[types field='post-url' item='@issue-editorspeak.child' output='raw'][/types]
I have tried it in my localhost, it works fine.
Please check you are using correct relationship slug and field slug, if you need more assistance for it, please provide a test site with the same problem, I need to test it in a live website, private message box enabled
Hi Luo Yang
My staging server is currently being tested by Toolset for another ticket so will provide you access once that is resolved.. in the meantime I checked my code and it's exactly how you asked me to do it..
[types field='post-url' item='@issue-editorspeak.child' output='raw'][/types]
I've attached the screenshot too.. and here's the live link .. enlace oculto
Not sure what I am doing wrong..
Regards,
Alim
I don't see anything wrong in your codes, please update here when your test site is ready for debug, private message enabled again.
Please check the "EditorSpeaks" post: Vol 8 Issue 2:
enlace oculto
There isn't any custom field is using slug "post-url", the shortcode [types ...][/types] is for rendering custom field value.
If you want to display post URL, you can use view's shortcode [wpv-post-url], for example:
<a href="[wpv-post-url item='@issue-editorspeak.child']">Read More</a>
More help:
enlace oculto
My issue is resolved now. Thank you!
Thanks Luo Yang..:-)..
Regards,
Alim