Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function advance_newpage_search() {
- $args = array();
- $args['wp_query'] = array( 'post_type' => array('job'),
- 'orderby' => 'title',
- 'order' => 'ASC' );
- // Here is where we specify the page where results will be shown
- $args['form'] = array( 'action' => get_bloginfo('url') . '/newpage' ); // create a page what slug name is "newpage".
- $args['fields'][] = array( 'type' => 'search',
- 'class' => array('form-group','form-control'),
- 'placeholder' => 'Enter search terms' );
- $args['fields'][] = array( 'type' => 'meta_key',// Because it is meta box
- 'class' => array('form-group','form-control'),
- 'format' => 'select',
- 'meta_key'=>'job_type', // job_type is the meta key id
- 'values' => array(
- 'Fulltime' => 'Full Time',// FullTime is the value of meta boxes and so on...
- 'PartTime'=>'Part Time',// PartTime is the value of meta boxes.
- 'Contractual'=>'Contractual',
- ) );
- $args['fields'][] = array( 'type' => 'taxonomy',// taxonomy outomitac asbe
- 'class' => array('form-group','form-control'),
- 'format' => 'select',
- 'taxonomy'=>'job_locationa',// "job_locationa" is the taxonomy name.
- );
- $args['fields'][] = array( 'type' => 'submit',
- 'class' => 'btn',
- 'value' => 'Search' );
- register_wpas_form('newpage', $args);
- }
- add_action('init','advance_newpage_search');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement