Inicio › Toolset Professional Support › [Resuelto] Displaying the posts that are connected to a custom post that is connected to a
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.
Hoy no hay técnicos de soporte disponibles en el foro Juego de herramientas. Siéntase libre de enviar sus tiques y les daremos trámite tan pronto como estemos disponibles en línea. Gracias por su comprensión.
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)
Etiquetado: Displaying post relationships, Views plugin
Documentación relacionada:
Este tema contiene 17 respuestas, tiene 2 mensajes.
Última actualización por davidR-12 hace 6 años, 12 meses.
Asistido por: Minesh.
1. I have a post here:
enlace oculto
This displays a client post type in the right hand sidebar ('Chepstow'). This is connected to this post via a many to many child relationship.
The client page is here:
enlace oculto
Obviously, the client can be connected to many different posts via this relationship. I want a way to display all of these posts on any post that is connected to that client. How would I do this?
2. Each client also has a field that has twitter feed text in it (You can see it on the example client above). I want to display that twitter feed on any post connected to that client. How do I do that?
regards,
David
Hello. Thank you for contacting the Toolset support.
Well - have you gone through our post relationship Doc:
=> https://toolset.com/documentation/user-guides/many-to-many-post-relationship/
[Section: "Displaying Connected Content"]
If above Doc is not enough for you. I need to check your current relationship.
I also would like to confirm where you like to display all connected posts that is related to particular client.
*** 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 would additionally need your permission to de- and re-activate Plugins and the Theme, and to change configurations on the site. This is also a reason the backup is really important. If you agree to this, please use the form fields I have enabled below to provide temporary access details (wp-admin and FTP).
I have set the next reply to private which means only you and I have access to it.
Well - I can see its already working.
Please check here - this is client and at post relationship section I've added on more post.
enlace oculto
Now, when I see the client profile at frontend - I'ts displaying the post that is connected to client.
=> enlace oculto
Is this your expected output or I unfortunately misunderstood your requirement?
Hi Minesh,
No thats not it. You've just described the system that I have already set up.
A post will have a client connected to it. A client can have multiple posts connected to it. I want to display all posts connected to a client on EACH post.
So, for example, client A has post A and post B connected to it through a many to many relationship. On post A, in the sidebar post A and post B will appear (Although ideally not the post that is currently displaying).
I need the posts to appear on the posts, not on the clients (that's a system I have already set up as demonstrated by you).
Regards,
David
For example - I'm on this post currently:
=> enlace oculto
Now, above post is connected to client "Emyr Pierce" and I do not see there are more posts attached to client "Emyr Pierce" - could you please confirm which posts it should display and then I will try to offer you the solution.
Hi Minesh,
It wont display anything at the moment. I'm asking you how to do something so obviously I havent set it already as then I wouldnt need your help.
I dont know how to describe what i want any more simply so I'm just going to re-post it:
"A post will have a client connected to it. A client can have multiple posts connected to it. I want to display all posts connected to a client on EACH post.
So, for example, client A has post A and post B connected to it through a many to many relationship. On post A, in the sidebar post A and post B will appear (Although ideally not the post that is currently displaying).
I need the posts to appear on the posts, not on the clients (that's a system I have already set up as demonstrated by you)."
David
Well - as per my understanding I've modified the code as given under:
I've created another view "display-related-client-posts" and added this view to "Clients Widget View" as given under:
[wpv-view name="display-related-client-posts" ids="[wpv-post-id]" parent="[wpv-post-id id='$client']"]
You can check the query filters added to view "display-related-client-posts".
Post relationship filter Select posts that are children of the Post with ID set by the shortcode attribute parent. eg. [wpv-view name="view-name" parent="123"] Post ID filter Exclude posts with IDs set by the View shortcode attribute "ids" eg. [wpv-view name="view-name" ids="1"]
I've added one post "toolset test" that is connected to same client as per below link:
=> enlace oculto
And you can see same "toolset test" post with above link. could you please confirm is this the expected output?
Hi Minesh,
Thank you that works perfectly. So to point 2:
2. Each client also has a field that has twitter feed text in it (You can see it on the example client above). I want to display that twitter feed on any post connected to that client. How do I do that?
Regards,
David
Could you please check now, I've added following code to view "display-related-client-posts".
<div class="social-quarter"> [types field='client-twitter-feed' id="[wpv-attribute name='parent']"][/types] </div>
I can see its displaying correct twitter feed. Could you please confirm.
Hi Minesh,
That works great as long as there is more than one post attached to a client. When there is only one post attached then the twitter feed does nto display. I have removed the 'toolset test' post form the client here and the twitter feed does not appear on this post:
enlace oculto
Regards,
David
Could you please check now, I've change the place where I've added twitter-feed code.
=> enlace oculto
It will show now even no posts found.
Could you please confirm - it works as expected.
Hi Minesh,
Can you tell me what you have changed as I need to transfer it to the live site.
Regards,
David
I've made changes to this view:
=> enlace oculto
I've added the following code just BEFORE the [wpv-layout-end] shortcode. You can see with above link:
<div class="social-quarter"> [types field='client-twitter-feed' id="[wpv-attribute name='parent']"][/types] </div>
I hope everything is working on your live site as well and we can close here 🙂