Skip Navigation

[Resolved] Editing single product template

This thread is resolved. Here is a description of the problem and solution.

Problem:
The user would like to build a theme template and include the Types field on it.

Solution:
Toolset does not act or allow to modify theme's templates. Toolset acts only on the return of the the_content() function.

We can create a Toolset Content Template for your custom post types or for specific posts. But the resulting HTML will only replace the_content() function from the theme's template.

Relevant Documentation:
For more information on how to customize Toolset based website using PHP, check the articles on this documentation page.

This support ticket is created 3 years, 11 months ago. 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.

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: Africa/Casablanca (GMT+01:00)

This topic contains 3 replies, has 2 voices.

Last updated by giuseppeU 3 years, 11 months ago.

Assisted by: Jamal.

Author
Posts
#1908913

Hi again,
sorry if I keep asking for explanations, but I try to understand how to make this fantastic Toolset work best.
I was wondering: how to add only a custom field in a given template without using the Toolset visual editor?
I mean, if it is possible to insert within a single product template a php code or a shortcode as I do, for example, with ACF (get_field ("name_field")).
Or, alternatively, use the Toolset editor to edit the existing theme default template?
This approach would be useful for me because it saves me from modifying the single product template, since the customer does not want it to be modified.

#1909115

Hello, I am not sure what do you mean by "modifying the single product template". So, I'll try to comment on each of your questions.

I was wondering: how to add only a custom field in a given template without using the Toolset visual editor?
This is totally possible. Check this article and let me know if you have further questions:
- https://toolset.com/documentation/customizing-sites-using-php/functions/
- https://toolset.com/documentation/customizing-sites-using-php/creating-templates-single-custom-posts/
Note that the fields that are created through Toolset use a prefix at the database level 'wpcf-'.

Or, alternatively, use the Toolset editor to edit the existing theme default template?
Toolset does not act or allow to modify theme's templates. Toolset acts only on the return of the the_content() function.

This approach would be useful for me because it saves me from modifying the single product template, since the customer does not want it to be modified.
You can create a Toolset Content Template for your custom post types or for specific posts. But the resulting HTML will only replace the_content() function from the theme's template.

For more information on how to customize Toolset based website using PHP, check the articles on this documentation page. Feel free to open a new ticket or chat for any further questions.
https://toolset.com/documentation/customizing-sites-using-php/

#1909171

Perfect. So, if I want to display a custom taxonomy for that product, should I use this code?
<! -? php echo (types_render_field ('custom_taxonomy')); ? ->
Or do I have to enter a reference to the product id?

#1909303

My issue is resolved now. Thank you!