Skip to content

Instantly share code, notes, and snippets.

@yousufansa
Created October 11, 2018 08:49
Show Gist options
  • Save yousufansa/ef3dfb1ec45cc4d61c9aee546675f91b to your computer and use it in GitHub Desktop.
Save yousufansa/ef3dfb1ec45cc4d61c9aee546675f91b to your computer and use it in GitHub Desktop.
Jobhunt - Enable Header Job Search
if ( ! function_exists( 'jobhunt_header_job_search_icon' ) ) {
/**
* Displays Header Job Search Icon
*/
function jobhunt_header_job_search_icon() {
if ( jobhunt_is_wp_job_manager_activated() && function_exists( 'jobhunt_job_header_search_block' ) ) {
echo '<li class=header-search-icon>';
echo '<span class="search-btn"><i class="la la-search desktop-only"></i><i class="fas fa-search handheld-only"></i></span>';
$args = apply_filters( 'jobhunt_header_job_search_icon_args', array(
'section_title' => '',
'sub_title' => '',
'search_placeholder_text' => esc_html__( 'Job title, keywords or company name', 'jobhunt' ),
'location_placeholder_text' => esc_html__( 'City, province or region', 'jobhunt' ),
'category_select_text' => esc_html__( 'Any Category', 'jobhunt' ),
'show_category_select' => true,
'show_browse_button' => false,
) );
jobhunt_job_header_search_block($args);
echo '</li>';
}
}
}
add_action( 'jobhunt_secondary_nav_before', 'jobhunt_header_job_search_icon', 10 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment