Hi, I’d love to be able to use a saved row or template as the global header or footer of my site so they remain editable rather than hardcoding them into a theme but obviously I don’t want to force my users to add the header/footer for every page. Is there a programmatic way for me to render a saved row/template (templates are custom post types right?) from within my theme? Even better would be also a method to grab a list of all saved rows or templates so I can construct a header and footer select box in customizer and let the user pick which saved row/template to use as the header/footer.
I think I saw a filter that lets you enqueue the css/js resources of a particular template on all pages, I’m just missing what method to call to actually render the layout.
Has anyone else managed this?
Hey Brent! Thanks for touching base and for sharing your suggestions. We have some ideas/plans that will hopefully make this a lot easier in the future. For now, you can do this using a plugin called Insert Pages…
https://wordpress.org/plugins/insert-pages/
What you can do, is create a page and load your global row or module onto that page. Then, you can use the insert pages plugin to use the global module/row in your theme’s template files. Basically, Insert Pages gives you a shortcode that lets you pull the content from another page into your current page.
You will need to use the fl_builder_global_posts filter to load the page’s assets globally. See here:
http://forum.wpbeaverbuilder.com/knowledge-base/filter-reference/
I like the idea to have a method to grab saved rows/modules. If you have a second, do you mind adding that as a feature request on our User Voice page:
https://wpbeaverbuilder.uservoice.com/
Hope that helps. Let me know if you have any other questions…
Robby - do you think you could give a step-by-step example on this please as I would like to use it on a Genesis theme.
A video would be a real help - just a thought.
Thanks
Mark, sure! Seeing this makes me realize it would make for an awesome blog post. Give me a few days to put it all together, but I will try to get an extended tutorial on this technique for ya!
Fantastic stuff - thanks Robby - that will be perfect.
Much appreciated and looking forward to the tutorial.
Cool stuff!
Loving BB more and more each day!
+1 for a saved row/template global for footer.
Could we add this easily to blog single posts in BB Theme?
Right now is the only major downside I saw working with BB for about 1 month
Gualha, “easily” depends on your comfort level with writing code, but yes! I started on the video last night, I decided I need a new microphone, though It should be out some time next week!
Brilliant - thanks Robby - much appreciated.
Looking forward to the video and making BB even more amazing with my theme.
The support on here is the best I’ve ever come across.
Keep up the excellent work guys
Hey Robby - just wondered how you were getting on with the blog post and tutorial - did you manage to sort out your microphone yet lol!
Looking forward to learning some more about what can be achieved with BB
Thanks,
Mark
Hi Mark! I am behind schedule! I am sorry. I did get the microphone sorted out. I am being a perfectionist now and trying to do “Screencasting 101” in as little time as possible, haha. I’ll have some time this weekend to get the video up. Thanks for being patient!
Waiting here also! Thanks Robby
Sorry if this is a little hijacky.
But for others looking at this I want to add that you need to customize the shortcode you get back from Insert Pages.
Change:
[insert page=‘resource-page-template’ display=‘title’]
To:
[insert page=‘resource-page-template’ display=‘content’]
Then you can insert it into your template file like so:
<?php echo do_shortcode("[insert page=‘resource-page-template’ display=‘content’]"); ?>
Hey Jason,
Thanks for the clarification! I’ve always used
display=‘content’
when testing since it’s the one I found over at their wp.org page.
Ben
Hey all! Thanks for your patience. I finished the tutorial video!! Woo-hoo!
I just finished uploading it, and it looks like it won’t be ready for about 45 minutes, but here is a link:
Let me know if anything is unclear or if anyone has questions.
Brilliant - thanks Robby.
Great tutorial and I’ve managed to get the header to work using the Genesis Dynamik theme - but get a strange result with the footer.
The page footer has three columns on it - Company Info, Latest News and Get Social – but when it replaces the theme footer using a hook, I only get two of the cols showing up Company Info and Latest News – the Get Social doesn’t appear.
Page Footer: http://newdesignkitchens.burntwoodwebdesign.co.uk/footer/
Actual Footer: http://newdesignkitchens.burntwoodwebdesign.co.uk
Any thoughts?
Mark! Sorry about that. Saw you opened a separate thread for this, so I’ll move the convo over there.
This is awesome, nice work @robby! Definitely keen to see this baked right into BB
Yep, into BB, and no coding needed!
Great great post above with the video tutorial, much needed and I’m pretty sure much of the Beaver community would want to see.
If I’m using the Beaver Builder theme, can I drop the Insert Pages shortcode into one of the CODE blocks in Customizer?