OceanWP: Hide the Top Bar on Selected Pages
Hides OceanWP's top bar on the pages you list, such as checkout or landing pages, while keeping it on the rest of the site.
Opens WPIDE on
Code
// Pages without the top bar.
$wpide_ocean_no_topbar = array( 'checkout', 'landing' );
add_filter( 'ocean_display_top_bar', function ( $display ) use ( $wpide_ocean_no_topbar ) {
return is_page( $wpide_ocean_no_topbar ) ? false : $display;
} );
Notes
Use page IDs or slugs.
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.