Kadence: Call-to-Action Band Above the Footer
Adds a full-width call-to-action band above the footer on every page of the Kadence theme, with a heading and button you set at the top.
Opens WPIDE on
Code
// CTA content and pages to skip.
$wpide_kadence_cta = array( 'heading' => 'Ready to start your project?', 'button' => 'Get a quote', 'url' => '/contact/' );
$wpide_kadence_cta_skip = array();
add_action( 'kadence_before_footer', function () use ( $wpide_kadence_cta, $wpide_kadence_cta_skip ) {
if ( $wpide_kadence_cta_skip && is_page( $wpide_kadence_cta_skip ) ) {
return;
}
printf(
'<section class="wpide-kadence-cta" style="padding:48px 20px;text-align:center;background:var(--global-palette1,#2b6cb0);color:#fff;"><h2 style="color:inherit;margin:0 0 16px;">%1$s</h2><a class="button" href="%2$s" style="background:#fff;color:#111;">%3$s</a></section>',
esc_html( $wpide_kadence_cta['heading'] ),
esc_url( $wpide_kadence_cta['url'] ),
esc_html( $wpide_kadence_cta['button'] )
);
} );
Notes
Add page IDs to $wpide_kadence_cta_skip to hide the band on those pages (for example the contact page).
How to add this snippet
- Install WPIDE on your WordPress site (it is free) and open Code Snippets.
- Use snippet above adds it from the library in one click. Or copy the code into a new snippet with the same code type.
- It is added inactive: review the code and settings, then switch it on.