Out of the box “Beaver Builder theme” comes with lot of options via the customizer panel. You can easily extend Beaver theme to add more refined customizations using theme hooks. Beaver theme has lot of pre-defined hooks (view Beaver theme hooks) which you can use to neatly display additional content in the front-end.
Create new widget area in Beaver theme
Creating a new widget area involve following three steps:
1. Register a new widget area.
2. Hook widget to a specific location in the theme.
3. Define function with the code it will execute.
Code to add new widget area in Beaver theme
*** Backup before making any code changes ***
1. In WordPress dashboard, go to Appearance > Editor
2. Click to open “Theme Functions” (functions.php) file.
3. Add the following code at bottom of functions.php file.
This code will add a new widget area “Top Section” to your Beaver theme. To add contents to this widget area, go to Appearance > Widgets and then drag & drop any widget to “Top Section” widget area.
Use Beaver template Shortocde in this widget
By default, shortcodes do not execute (or work) when placed directly in a widget area. However, you can easily enable shortcode execution by adding following code at the end of your functions.php file
Extending code with conditionals
What if I want to show this widget area only on the homepage or specific on a page? You can easily add a conditional statement to this code.
Show widget only on the homepage. Use the following code instead:
Show widget only on specific page (Replace 34 with ID of that page).
Add new widget that does not show when “no header footer template” is selected