Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@mikejolley
Last active April 21, 2022 01:36
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mikejolley/13061e3b1fc6fbb194ef to your computer and use it in GitHub Desktop.
Save mikejolley/13061e3b1fc6fbb194ef to your computer and use it in GitHub Desktop.
WP Job Manager - Custom search form
<form method="GET" action="YOUR_JOBS_PAGE_URL">
<p>
<label for="keywords">Keywords</label>
<input type="text" id="search_keywords" name="search_keywords" />
</p>
<p>
<label for="keywords">Location</label>
<input type="text" id="search_location" name="search_location" />
</p>
<p>
<label for="search_category">Category</label>
<select id="search_category" name="search_category">
<?php foreach ( get_job_listing_categories() as $cat ) : ?>
<option value="<?php echo esc_attr( $cat->term_id ); ?>"><?php echo esc_html( $cat->name ); ?></option>
<?php endforeach; ?>
</select>
</p>
<p>
<input type="submit" value="Search" />
</p>
</form>
@idshdx
Copy link

idshdx commented Jun 23, 2016

What variable from the query string is used for job types? I would like to add another input to filter by job types..

@isheraz
Copy link

isheraz commented Sep 15, 2016

Hi, can we do the same thing with location or regions like you've done with categories ?

@fsj-digital
Copy link

looks great - i like this very much

@larshaukohl
Copy link

I'm also searching for a solution like idzer0lis, to filter by job types, any news on that?

@piotrtrabski
Copy link

What is the best place for that code?

@RemoteDesignHub
Copy link

Amazing, thanks so much for this. You made my day.

@navinp
Copy link

navinp commented Oct 22, 2020

Is there a way to hide the listings by default, only show a search form? The shortcode [jobs] outputs a form, and below it, the most recent listings. I just need the search form :/

@mezc97
Copy link

mezc97 commented Apr 21, 2022

disculpe, como se colocaria la pagina a la que se esta redirigiendo para que muestre los resultados?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment