How to use shortcodes to add Beaver Builder modules in unsupported posts
Beaver Builder gives you the opportunity to decide which page and post types you’d like the plugin to be activated on. If you navigate to Settings > Page Builder > Post Types, you can specify which post type you would like the builder to work with. Not all custom post types are supported though and in general, we tend to avoid turning the builder on for anything other than pages or custom post types that we’ve designed to act like pages, rather than posts.
So if you don’t add the page builder to your post type you miss out on being able to use the many modules available that make using Beaver Builder so great. Maybe you’d like to add a button in the middle of your post, or a subscribe form? Not having access to the builder in your post type means you don’t have access to the modules either and given the amount new add-ons being published by 3rd party developers, you could be missing out on a tonne of useful elements.
There are ways to solve that problem. In this tutorial, we’ll show you how to add modules to your unsupported post types suing standard Beaver Builder shortcodes.
Enable Beaver Builder Templates
This method relies on making use of page templates so head over to your WordPress Admin, Settings > Page Builder > Templates tab and enable all templates and activate the option ‘Enable Templates Admin’. In effect, this setting adds a new section in your admin area called ‘Templates’ which, themselves are custom post types.
Create a new template
Now that we have our templates switched on, head over to Templates and click on ‘Add New’. In this new template, we’re going to add a ‘subscribe form’ that we would like to display halfway through our next blog post text. Call you new template ‘Subscribe Form’ or something equally as descriptive and then click on the blue ‘Launch Page Builder’ button to open up the front end page builder.
Now that we have our subscribe module set up, click on Done in the top right of the page builder, Publish your changes and click on edit template. Make a note of the Permalink of your template – it’s the last bit of the permalink that we need in the next step – in this case, it’s ‘subscribe-form’. You can also use the post ID in the shortcode – in this case, it’s ‘4’ – you can see the ID in the browser URL.
Add the shortcode to your post
In the next step, we’ll add the Beaver Builder shortcode to our post so that the subscribe form shows up in our blog post. If you have a post set up already, head over to your post editor and locate the position within your body text where you’d like to add your new subscribe form.
The Beaver Builder shortcodes for adding templates is shown below – use either the post slug or post ID method:
Once you’ve added your shortcode, save your post and head to the front end to review your results. Tweak your template layout to modify margins and padding or add headings or background colours to your module to make it really pop.
In the next post we’ll show you how to use Beaver Builder hooks to add modules to specifc parts of your posts.