Skip Navigation

[Resolved] Extend existing theme's single template with Toolset's entities with PHP code

This support ticket is created 4 years 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.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

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/Karachi (GMT+05:00)

This topic contains 2 replies, has 2 voices.

Last updated by Vane 3 years, 12 months ago.

Assisted by: Waqar.

Author
Posts
#1604075

Hi,

I'd like to extend Bimber theme's functionality with adding some Toolset entities to its single and archive templates, without using shortcodes,
( theme doesn't support CPTs as well as I need, I'm not able to use their archive layouts of Post for my CPT Brand Post ).

My original intent was to:
- either use one of Bimber's archive layout for my CPT Brand Post ( but the standard way of copying archive.php and save it as archive-brand-post.php into child theme's root folder didn't work )
- or add my CPT to Bimber's post collection, so the archive could display both Bimber's bative content types and my Brand Posts.
It's demo is here:
hidden link

So it is an example of a Brand Post CPT created with Toolset:
hidden link
where you can see:
- a related CPT called Brand ( 1-to-many )
- Context, as flat custom taxonomy

A standard WP post looks like this now:
hidden link
I'd like to use both related Brands and Context on DEFAULT WP posts ( it is enabled for that in Toolset ), but using Bimber's templates.

So could you help me how can I reverse engineer those templates,
or how can I add some custom php in the_content()
or how can I insert those entities into templates via PHP?

Thank you!

#1605131

Waqar
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Hi,

Thank you for contacting us and I'd be happy to assist.

Toolset plugins offer a number of API functions that can be used to show data in custom PHP code.

For example, you can use Types Fields API to get the Types custom fields data:
https://toolset.com/documentation/customizing-sites-using-php/functions/

To get related posts, you can use the "toolset_get_related_posts" function from the "Post Relationships API":
https://toolset.com/documentation/customizing-sites-using-php/post-relationships-api/#toolset_get_related_posts

And for showing attached taxonomy terms, you can use "wpv-post-taxonomy" shortcode, through "do_shortcode" function in PHP:
https://toolset.com/documentation/user-guides/views/views-shortcodes/#wpv-post-taxonomy
https://developer.wordpress.org/reference/functions/do_shortcode/

I hope this helps and please let me know if you need any further assistance around this.

regards,
Waqar

#1605161

Thank you, this is what I needed !

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.