Skip to content

Instantly share code, notes, and snippets.

@atcraigwatson
Created August 30, 2017 08:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save atcraigwatson/ba7c226536f70b50febe7ccc7b868120 to your computer and use it in GitHub Desktop.
Save atcraigwatson/ba7c226536f70b50febe7ccc7b868120 to your computer and use it in GitHub Desktop.
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