We would like to use the power of beaver builder into archives pages.
In a subtheme, for example into archive-{posttype_slugname}.php, we could test if a beaver template with the same name exists. If it exists, we could render this beaver template.
What is the best way to render a beaver template in PHP ?
That’s an interesting solution. You can pull in the HTML for a Beaver Builder layout the same way you would any other post, just make sure you’re using the_content within a loop.
In order to get the CSS and JS assets to load, you’ll need to use the fl_builder_global_posts filter.
Being able to create a BB template part (such as a masthead) and then being able to pull that into a hard-coded template so that all posts sharing that hard-coded template (such as a blog) would always look consistent (rather than using BB on a post by post basis) would be awesome.
Thanks for the additional info. I believe novfr is trying to do something similar, essentially bringing a Beaver Builder layout into another page.
You should be able to use that by querying the post and using the_content function. You’ll also want to have a look at the fl_builder_global_posts filter.
Thanks for the additional info. I believe novfr is trying to do something similar, essentially bringing a Beaver Builder layout into another page.
You should be able to use that by querying the post and using the_content function. You’ll also want to have a look at the fl_builder_global_posts filter.
Basically I would need to create a page that acts as a template part, then pull that in. Doesn’t seem very elegant, but I’m not sure what else I could do.
I think novfr’s idea of pulling in the name of a custom BB template is more ideal, but I couldn’t get it working. If there are any ideas out there, just let me know!
Thanks so much for posting that code. I’m more of a front-end developer, so I’m having a little trouble wrapping my head around what you posted.
Basically I want to pull in a saved BB template (let’s say it is named “masthead”) into a custom post type template (called single-propulsion.php).
So really the structure would be:
Header
Pulled in BB template named “masthead”
Content of custom post type entry
Footer
Thanks for the reply. I guess I’m trying to achieve what I believe you wanted to do in your original post, which is to call a “fl-builder-template” by it’s name. Something like this:
We finally decided to create our own custom post type named “template” to customize archive and single content (article, taxonomy, etc.). But it’s possible to use the official CPT of beaver.
I’m having trouble pulling data from “fl-builder-template”, but I’ll play around and see what I can come up with. Thanks again for the insight.
Hmm, still not pulling any data from “fl-builder-template”. I’m not sure what the issue is. I’ll stop bugging you guys, but if you happen to get the itch to find a working solution for what I want to do, just let me know!