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!
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
Thank you, this is what I needed !