Skip to content

Instantly share code, notes, and snippets.

@psahalot
Last active November 18, 2018 22:27
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save psahalot/6df7032919459a8a8da1967aef588b42 to your computer and use it in GitHub Desktop.
Save psahalot/6df7032919459a8a8da1967aef588b42 to your computer and use it in GitHub Desktop.
add search box to off-canvas menu
// Advanced Menu - off-canvas before menu items
function wpba_demo_offcanvas_menu_before( $type, $settings, $id ) { ?>
<style>
.wpba-menu-content { margin-top: 50px; padding: 40px; padding-bottom: 10px; }
</style>
<div class="wpba-menu-content">
<div class="wpba-menu-search">
<?php echo get_search_form(); ?>
</div>
<h3>About us</h3>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
</div>
<?php
}
add_action( 'pp_advanced_menu_before', 'wpba_demo_offcanvas_menu_before', 10, 3 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment