To add location
-
Is it possible to add more location fields to listing and submitting?
-
What fields are you after?
Some companies have two or more branches.
And some job seekers may find one job in a few places at the same time.
So it will be good to be able to enter two or more places in the location field
or to add the location field.Being an open text field, a company *could* list both, ‘anywhere’, or post 2 jobs. I don’t think multiple locations is a common occurrence? I’ve certainly never seen it on popular job sites. Have you?
Yes you are right.
And forget about the job seekers mentioned above.
But when it comes to the employers, they really want to add locations in job-submit-form because they have branches as I said above.
And of course the added locations should be shown in job-listing and single-job-listing.How common is it to advertise “a job” with multiple branches?
You could use the usual way of adding new fields to the forms (job_location_2, 3 etc) but the issue there is you won’t know how many locations are needed.
For such a seemingly edge-case, I don’t think this will be added to core.
I have added location2 next to location in job-submit, job-listing and single-job-listing. But the problem is that I don’t know how to show the map.
The codes go like this :
#functions.php
add_filter( ‘submit_job_form_fields’, ‘frontend_add_location2_field’ );
function frontend_add_location2_field( $fields ) {
$fields[‘job’][‘job_location2’] = array(
‘label’ => __( ‘Location2’, ‘job_manager’ ),
‘type’ => ‘text’,
‘required’ => false,
‘placeholder’ => ”,
‘priority’ => 3
);
return $fields;
}add_action( ‘job_manager_update_job_data’, ‘frontend_add_location2_field_save’, 10, 2 );
function frontend_add_location2_field_save( $job_id, $values ) {
update_post_meta( $job_id, ‘_job_location2’, $values[‘job’][‘job_location2’] );
}#content-job_listing.php
<div class=”location”>
<?php the_job_location( false ); ?>
<?php
$location2 = get_post_meta($post->ID, ‘_job_location2’, true);
echo “/”;
echo $location2;
?>
</div>#content-single-job_listing.php
<li class=”location” itemprop=”jobLocation”><?php the_job_location(); ?>
<?php
$location2 = get_post_meta($post->ID, ‘_job_location2’, true);
echo “/”;
echo $location2;
?>And other problems are that Location2 is not filterable in job-lising and how it is translated into other languages.
Jobify’s map adds another layer of complexity because they a) only look for 1 location field and b) use the generated geolocation data. I think its going to be difficult to do what you are attempting. I”d again suggest encouraging employers to list the same job in multiple locations so each gets plotted on your map.
No addons for this?
The topic ‘To add location’ is closed to new replies.