Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
A function to drop a quick job search section into the genesis layout
<?php
add_action( 'genesis_after_header', 'hiringsauce_add_quick_search_under_nav' );
function hiringsauce_add_quick_search_under_nav() {
?>
<div id="homepage-quick-search">
<form method="GET" action="https://hiringsauce.com/jobs">
<span>Quick Search</span>
<div>
<label class="screen-reader-text" for="keywords">Job Title / Keywords</label>
<input type="text" id="search_keywords" name="search_keywords" placeholder="Job Title / Keywords"/>
</div>
<div>
<label class="screen-reader-text" for="search_category">County / Region</label>
<select id="search_category" name="search_category">
<option>County / Region</option>
<?php foreach ( get_terms( 'job_listing_region' ) as $reg ) : ?>
<option value="<?php echo esc_attr( $reg->term_id ); ?>"><?php echo esc_html( $reg->name ); ?></option>
<?php endforeach; ?>
</select>
</div>
<div>
<input type="submit" value="Search" />
</div>
</form>
</div>
<?php
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment