Skip Navigation

[Resolved] Only modify original template – Extra theme

This support ticket is created 6 years, 2 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: Asia/Hong_Kong (GMT+08:00)

This topic contains 1 reply, has 2 voices.

Last updated by Luo Yang 6 years, 2 months ago.

Assisted by: Luo Yang.

Author
Posts
#1154961

Tell us what you are trying to do?
I am using Elegant Themes EXTRA THEME with DIVI builder.
With this I cannot create a Custom Post Type because according to their support they cannot display it with their Category builder.

1. So I have decided to create 2 types of posts: regular and recipes.
2. If the site's editor creates a post with post type recipe it should show a couple of fields to fill (time to cook, difficulty level, cuisine etc. ) out and taxonomies as well (e.g. ingredients).
3. If a post is a recipe then on the front end these extra fields should show up.
4. I would like to create a search based on these new fields.

My problems:
1. I would only like to modify the template of single-post.php and does not want to build it from scratch. I like the way it looks now, I would only like to add the new fields. I canot find a way to do this, please help me out.

2. I would like to create an Ingradients listing option.
What is the difference between creating a flat ingredients taxonomy for Post.
Or creating regular post/recipe choser and a conditional group of fields for Recipes and in that group creating a single line text for Ingredients.

Is there any documentation that you are following?
Yours.

Is there a similar example that we can see?

What is the link to your site?
hidden link

Thanks in advance.

Zsuzsa

#1155238

Dear Zsuzsa,

Q1) I would only like to modify the template of single-post.php and does not want to build it from scratch. I like the way it looks now, I would only like to add the new fields. I canot find a way to do this, please help me out.

I assume you are going to modify your theme file "single-post.php", and display custom fields created by Types plugin, if it is, you can setup custom PHP codes to display the custom field value using Types function types_render_field (), see our document:
https://toolset.com/documentation/customizing-sites-using-php/functions/

Q2) What is the difference between creating a flat ingredients taxonomy for Post.
Or creating regular post/recipe choser and a conditional group of fields for Recipes and in that group creating a single line text for Ingredients.

I assume we are talking about the difference between custom taxonomy and repeatable field groups.
A flat taxonomy works just like the wordpress built-in taxonomy "Tags", you can choose/create new tags in that taxonomy, but you can not setup quantity of ingredient for each Recipe.

But repeatable field groups can do this job for you, for example:
- Recipe 1
ingredient A : quantity 10
- Recipe 2
ingredient B : quantity 8

So I suggest you setup a repeatable field groups "ingredient" for post type "Recipe"

See our document:
https://toolset.com/documentation/getting-started-with-toolset/creating-and-displaying-repeatable-field-groups/