OceanWP: Notice Bar Below the Header
Shows a notice bar right after the OceanWP header on every page, for announcements that should be seen but not block the menu.
Opens WPIDE on
Code
// Message to show.
$wpide_ocean_notice = 'New: same-day pickup is now available in store.';
add_action( 'ocean_after_header', function () use ( $wpide_ocean_notice ) {
if ( '' === trim( $wpide_ocean_notice ) ) {
return;
}
echo '<div class="wpide-ocean-notice" role="status" style="background:#13aff0;color:#fff;text-align:center;padding:10px 16px;">' . wp_kses_post( $wpide_ocean_notice ) . '</div>';
} );
Notes
Leave the message empty to hide it.
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.