Add a CTA on the Essence Pro hero image on inner pages (i.e. not on home page).
A member in the Genesis Facebook group asked for help adding a hero section button to secondary pages. I guessed that it would be reasonably easy so I gave it a try.
Find the hook
I have Essence Pro installed locally as I have used it on a few client sites and I have written about customisations I have made for it e.g. Move title off hero image and use CMB2 to set product hero image.
Essence Pro 1.4 uses the Customizer to add the two hero buttons on the front page.
In the Customizer one button has the label “Hero White Button Text“. I found this in essence-pro/lib/customizer/customize.php and its control ID is ‘essence-button-primary-text‘ which I then found in essence-pro/page-templates/blocks.php in the essence_intro_description() function. This function is called in the ‘essence_entry_header‘ action, with priority 11. I would simply use the same action and priority.
Exclude front page
To ensure the new CTA looked like the one on the home page I copied the markup and changed the url and link text.
To exclude the new CTA from the home page I used the is_front_page() check.
The code puts the same CTA link on all inner pages. CMB2 or ACF could be used to allow setting links or excluding the CTA on a per page basis.