How to show contact section on each page in Hestia Pro
If you are using Hestia Pro theme, it can be done easily without editing the code. Hestia Pro theme provides shortcodes of frontpage sections and we will use the shortcode of contact section [hestia_contact] to duplicate it on other pages.
Follow the steps:
- Go to WP-admin > Appearance > Hestia Pro Hooks.
- Inside "Before Footer" hook editor add the following code:
- After that click on the "Save Hooks" button.
- Add the below CSS to Appearance -> Customize -> Additional CSS section to adjust the background image appearance.
<?php if ( ! is_front_page() ) : ?> [hestia_contact] <?php endif;?>
Don't forget to enable the Execute PHP option below the hook area.
body:not(.home) section#contact{ background-position: center center; background-size: cover; position:relative; } body:not(.home) section#contact:before{ content: ''; position: absolute; z-index: 0; top: 0; right: 0; bottom: 0; left: 0; background-color: rgba(0,0,0,0.7); }
That's it, now the contact section will appear on each page of your website.