[Résolu] How to get related posts with a dynamic parent post ID
This support ticket is created Il y a 3 années et 2 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.
Is there any documentation that you are following? I didn't found a document for the legacy view creation anymore.
The second question is, how do I set this view, to get infinite scrolling pagination? So that it shows first 6 related posts, and then when the customer is scrolling down, it will showing all the times 3 more.
Is there a similar example that we can see? lien caché
Thank you for getting in touch. But we like to get it "dynamically"... - so is it possible to have a shortcode instead of a fixed number? Something like this:
This is exactly the way to do it, given that you want to dynamically get the parent ID of the current post. However I would format it a little different so that the quotations don't get closed early. Use the one below.
Notice the use of the double quotes. The second question is, how do I set this view, to get infinite scrolling pagination? So that it shows first 6 related posts, and then when the customer is scrolling down, it will showing all the times 3 more.
When you are doing the pagination there is a fixed number of items per page. What this means is that you won't be able to start your view with 6 posts and then paginate by 3 posts. If the view is started with 6 posts then the pagination will bring the next 6 posts when scrolling down.
To enable the infinite scroll pagination, you will need to first edit your view then scroll to the "Pagination and Sliders Settings" if you're not seeing this scroll to the top of the edit screen and click screen options in the top right then enable it there.
Now once the section is enabled select "Pagination enabled with manual transition and AJAX" under "Transition effect: " select Infinite Scroll.
About the first part - is there another way to do it? Somehow the theme we use isn't 100% compatible, and having some small issues with show everything correct:
I know that for some theme or page builders when using their shortcode editor you will get a broken "] at the end because they aren't compatible with nested shortcodes.
Secondly you should just be able to return the do_shortcode() function.
So using the return would be fine.
Thanks,
Shane
Ce ticket est maintenant fermé. Si vous êtes un client de Toolset et que vous avez besoin d'aide, veuillez ouvrir un nouveau ticket d'assistance