By default, the Essence Pro themes front page header hero section displays 2 buttons. In this tutorial, you’ll get :
- A custom reusable block you can import.
- And a file named blocks.php you can upload to display your reusable email optin block like this :
Note : The code in the blocks.php file shows you how to use a few lines of PHP code to display any block in any location in any theme.
Shows you how to integrate your MailChimp email form in the header hero section on the front page of the Essence Pro child theme by StudioPress.
Also provides the PHP code snippet which shows you how to display a block in any hook position using PHP code.
There’s 2 steps once you’ve setup your email newsletter block using the Genesis Blocks plugin:
Note : This solution assumes you’re using MailChimp API keys in the Genesis Blocks > Settings > Newsletter Block settings.
You can access your reusable blocks page using these steps :
- # Find your MailChimp audience I.D and edit the newsletter-optin.json file with the 10 digit mailingList number. On your Reusable blocks page, import the newsletter-optin.json file. Once imported, edit the block to grab the post id from the address bar which you’ll need in step 2.
- # Edit the file named blocks.php on line 66 replacing the 83 with the id for your reusable block as seen using the 1st red arrow in the screenshot in step 1. You can then upload the file to your Essence Pro themes blocks folder.