[Résolu] Ok the API is great but where should we use it ?
This support ticket is created Il y a 5 années et 6 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.
Normally we would add the custom code in the Toolset custom code section in Toolset-> Settings -> Custom code.
"And if I want to add custom PHP code to the view of a custom post, where should I write ite please ?" The custom code will be added in the same custom code section.
However could you let me know what kind of custom code will this be for the view ?
so the code should not be written in the functions.php file ?
as for the custom code we whish to write for the view here are some examples :
- there is a hidden custom field that contains a value and we need to make a href link upon a visible field with the value of the hidden field
- depending on the value of a custom field we show or hide another field
- depending on the value of a custom field we compute a SQL query, take the return values and display them in the view
"So the code should not be written in the functions.php file ?"
You can write it here however having your custom code not in the theme file would be ideal since you can retain the functionality even if you switch the theme.
-depending on the value of a custom field we compute a SQL query, take the return values and display them in the view
This you would probably need to construct a custom shortcode to achieve but its definitely possible.