????
Current Path : /home2/morganrand/backup.morganrand.com/wp-content/themes/wanderfuls/framework/ |
Current File : /home2/morganrand/backup.morganrand.com/wp-content/themes/wanderfuls/framework/search-functions.php |
<?php /** * Core search functions * * @package Wanderfuls WordPress theme * @subpackage Framework */ /** * Defines your default search results page style * * @since 1.5.4 */ function tb_search_results_style() { return apply_filters( 'tb_search_results_style', tb_get_mod( 'search_style', 'default' ) ); } /** * Adds the search icon to the menu items * * @since 1.0.0 */ function tb_add_search_to_menu ( $items, $args ) { // Only used on main menu if ( 'main_menu' != $args->theme_location ) { return $items; } // Get search style $search_style = tb_global_obj( 'menu_search_style' ); // Return if disabled if ( ! $search_style || 'disabled' == $search_style ) { return $items; } // Get header style $header_style = tb_global_obj( 'header_style' ); // Get correct search icon class if ( 'overlay' == $search_style) { $class = ' search-overlay-toggle'; } elseif ( 'drop_down' == $search_style ) { $class = ' search-dropdown-toggle'; } elseif ( 'header_replace' == $search_style ) { $class = ' search-header-replace-toggle'; } else { $class = ''; } // Add search item to menu $items .= '<li class="search-toggle-li tb-menu-extra">'; $items .= '<a href="#" class="site-search-toggle'. $class .'">'; $items .= '<span class="link-inner">'; $items .= '<span class="fa fa-search"></span>'; if ( 'six' == $header_style ) { $items .= '<span class="tb-menu-search-text">'. _x( 'Search', 'Navbar Search Text For Vertical Nav', 'tb' ) .'</span>'; } $items .= '</span>'; $items .= '</a>'; $items .= '</li>'; // Return nav $items return $items; } add_filter( 'wp_nav_menu_items', 'tb_add_search_to_menu', 11, 2 );