Add/Remove Elements From The Mobile Menu

// Sample function to add/remove items from the mobile menu
function my_add_to_mobile_menu( $array ) {
 
    // Add element with ID my-custom-id
    $array['my-custom-id'] = '#my-custom-id';

    // Remove search
    if ( isset( $array['search'] ) ) {
        unset($array['search']);
    }
    
    // Return items
    return $array;

}
add_filter( 'ocean_mobile_menu_source', 'my_add_to_mobile_menu' );

All PHP snippets should be added via a child theme's functions.php file.

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.