wp job manager add experience field
-
I tried to add experience field in job submission with these code but it’s not displaying in job listing
// Add EXPERIENCE custom field add_filter( 'submit_job_form_fields', 'frontend_add_experience_field' ); function frontend_add_experience_field( $fields ) { $fields['job']['job_experience'] = array( 'label' => __( 'Experience', 'job_manager' ), 'type' => 'select', 'options' => array('Select experience', '1+ years' => '1+ years', '2+ years' => '2+ years', '3+ years' => '3+ years', '4+ years' => '4+ years', '5+ years' => '5+ years'), 'required' => false, 'placeholder' => '', 'priority' => 4.2 ); return $fields; }and for displaying in job listing I used this code
add_action( 'single_job_listing_meta_end', 'display_job_experience_data' ); function display_job_experience_data() { global $post; $experience = get_post_meta( $post->ID, '_job_experience', true ); if ( $experience ) { echo '<li>' . __( 'experience:' ) .'$' . esc_html( $experience ) . '</li>'; } }but it always show experience 1+ in job listing
please help me in the both codes
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
The topic ‘wp job manager add experience field’ is closed to new replies.