Kadence: Message Bar Above the Header
Adds a slim announcement bar above the Kadence theme header on every page, using Kadence's own header hook.
Opens WPIDE on
Code
// Message to show above the header.
$wpide_kadence_bar = 'Holiday orders: order by <strong>Dec 18</strong> for delivery before Christmas.';
add_action( 'kadence_before_header', function () use ( $wpide_kadence_bar ) {
if ( '' === trim( $wpide_kadence_bar ) ) {
return;
}
echo '<div class="wpide-kadence-bar" style="background:#1f2937;color:#fff;text-align:center;font-size:14px;padding:8px 16px;">' . wp_kses_post( $wpide_kadence_bar ) . '</div>';
} );
Notes
Leave the message empty to hide it. Edit the colors in the inline style.
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.