Skip Navigation

[Résolu] Return number of item in results of a query

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.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9: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/Hong_Kong (GMT+08:00)

Marqué : ,

Ce sujet contient 1 réponse, a 2 voix.

Dernière mise à jour par Luo Yang Il y a 5 années et 11 mois.

Assisté par: Luo Yang.

Auteur
Publications
#905251

Simple question: Is there a way to return a number (serial) for each item returned as a result of a query? In the OUTPUT I'd like to use the number of the item in resulting items from a query.
If there are 10 results I'd like a snip of code to put in the output that gives the # of that item in the result based on the order the query. Example: Let's say I have 20 posts in a CFT called "tour-days" and I've queried them to result in 10 items and want to list them each individually. I'm displaying one result of the ten in 10 different places on a single page using a view using limit="1" and offset"x" (0 through 9). I want the Output to look like this: "Tour Day 1 - Wine Tasting in Napa Valley" (limit="1" offset="0"). In another part of the page I want "Tour Day 2 - The Golden Gate Bridge" (that one is limit="1" offset="2") Is there any way to generate displaying the "1" and "2" in the serialized list?
Is there any documentation that you are following? No
Is there a similar example that we can see? Shown above.
What is the link to your site? This conceptual. Might it use it for food tours on the restaurant review site: lien caché
Thanks

#905333

Hello,

There isn't such a built-in feature within Toolset plugin, you will need to setup the value of attribute "offset" manually, or you can setup a custom shortcode for it, see wordpress document:
https://codex.wordpress.org/Function_Reference/add_shortcode

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