[Résolu] Display view content with The Grid Plugin – part 2
This support ticket is created Il y a 5 années et 11 mois. 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.
Aucun de nos assistants n'est disponible aujourd'hui sur le forum Jeu d'outils. Veuillez créer un ticket, et nous nous le traiterons dès notre prochaine connexion. Merci de votre compréhension.
The code you provided to me work, I'm able to display the latest post form the "Thematique" I'm in. But it display only the first latest post. I want my grid to display the right number of post accordingly to the number I set on Plugin settings.
In that sample I added some error_log calls to help with debugging.
When you visit a thematique post (which is supposed to show the related standard posts), what do you see in your debug.log?
(If you deleted those error_log calls, add back the error_log call for related posts to be able to see what is returned by the relationships API call.)
Les langues: Anglais (English )Espagnol (Español )
Fuseau horaire: Europe/London (GMT+00:00)
Thanks for sharing that.
That confirms that the thematique post you are displaying only has a single post (ID = 383147) connected to it, which is why only one post is being displayed, regardless of the setting for how many posts the grid should display. There is only one post to display.
If you connect more posts to that same thematique post, then you should see more results in the grid.
Yes I understand what you say and this is the problem I have connected 3 post for my test, like I show you on my screenshot, and on the front end it display only the latest.
Maybe I have connected post on a bad way ? I don't know.
Les langues: Anglais (English )Espagnol (Español )
Fuseau horaire: Europe/London (GMT+00:00)
Can I take a look at your site myself?
I may need to install one or two plugins to help with debugging, but I won't otherwise make any changes.
Be sure to have a current back up, though.
I will mark your next reply as private so that I can get log-in credentials from you—you may want to create a temporary admin user for me to use that you can later delete.
Les langues: Anglais (English )Espagnol (Español )
Fuseau horaire: Europe/London (GMT+00:00)
I checked your site and everything seemed set up correctly, but then testing the toolset_get_related_posts hook on my own local test site I realised that one of the parameters was provided incorrectly, which is why only one post was being returned.
I fixed the code on your site, and it is now working correctly.