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;
?>