Tagged: vertical menu
-
AuthorPosts
-
September 5, 2017 at 3:02 pm #848134
Hi There,
Within the vertical menu we would like to add a search box under the menu. How can we achieve this with functions.php or using child theme?
Thanks!
September 5, 2017 at 6:37 pm #848265Hey elbnetz,
Please provide a link to the site/page in question so we can provide further assistance.
Best regards,
Jordan ShannonSeptember 5, 2017 at 7:04 pm #848286This reply has been marked as private.September 6, 2017 at 7:40 am #848460Hi,
So I can seen how the menu is structured, inspect the page, and give you an accurate solution. Without actually seeing your site, I’m giving you a general answer. You do want me to be as specific as possible for your exact need right?
Best regards,
Jordan ShannonSeptember 6, 2017 at 9:29 am #848508Ok, you got the credentials.
Thanks.September 8, 2017 at 7:37 am #849447Hi,
Please refer to this thread for a possible solution.
// https://kriesi.at/support/topic/search-function-in-header-left-sidebar/#post-772268
Best regards,
IsmaelSeptember 8, 2017 at 8:24 am #849467Hi Ismael,
Thanks it works to show the magnifier icon.
How could we achieve to just show the search field?Thanks
- This reply was modified 7 years, 2 months ago by elbnetz.
September 9, 2017 at 5:12 am #849827Hi,
Replace the code or filter with:
/** * Add search toggle on left sidebar header layout */ add_filter( 'wp_nav_menu_items', 'avia_append_search_side_nav', 10, 2 ); function avia_append_search_side_nav( $items, $args ) { if (is_object($args) && $args->theme_location == 'avia') { global $avia_config; ob_start(); get_search_form(); $form = ob_get_clean(); $items .= '<li id="menu-item-search" class="noMobile menu-item menu-item-search-dropdown">'.$form.'</li>'; } return $items; }
Best regards,
IsmaelSeptember 11, 2017 at 9:23 am #850389Thanks, but there must be an error in the code. We see now below the menu:
<form action="http://wp.serviceocean.com/" id="searchform" method="get" class=""> <div> <input type="submit" value="" id="searchsubmit" class="button avia-font-entypo-fontello" /> <input type="text" id="s" name="s" value="" placeholder='Suche' /> </div> </form>
September 12, 2017 at 7:48 am #850812Hi,
Thank you for the update.
We modified the code a bit. Please try it again then add this css code in the Quick CSS Field.
#top #searchform > div { opacity: 1 !important; display: block !important; }
Best regards,
IsmaelSeptember 12, 2017 at 8:49 am #850866Thanks, we used the following code and it worked well:
/**
* Add search toggle on left sidebar header layout
*/
add_filter( ‘wp_nav_menu_items’, ‘avia_append_search_side_nav’, 10, 2 );
function avia_append_search_side_nav( $items, $args )
{
if (is_object($args) && $args->theme_location == ‘avia’)
{
global $avia_config;
ob_start();
get_search_form();$items .= ‘<li id=”menu-item-search” class=”noMobile menu-item menu-item-search-dropdown”>
‘.$form.’
‘;
}
return $items;
} -
AuthorPosts
- The topic ‘Vertical Menu – Search Box under menu’ is closed to new replies.