• Resolved rohitkalra

    (@rohitkalra)


    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)
  • Hopefully, you’ll receive a other helpful responses, but if not, the WP Job Manager Field Editor plugin will allow you to do this easily, and I highly recommend it!

    Plugin Author Jake Morrison

    (@jakeom)

    Howdy!

    I tried the snippets you posted, selected “4+ years” on the job submission form, and it showed up correctly:
    https://cld.wthms.co/YDUzQv

    Is this where you’re seeing only 1+?

    Jake

    Thread Starter rohitkalra

    (@rohitkalra)

    Thanks for your reply but i don’t know why in mine case it shows every time only 1+ experience even after selecting 3+ 2+ etc

    Thread Starter rohitkalra

    (@rohitkalra)

    one more thing what i did i just copied the code for displaying salary and edited that code and changed word salary with experience. As you can see even in your case $ symbol is showing before experience
    Can you post some other code for experience as in my case it shows only 1+ experience every time

    Thread Starter rohitkalra

    (@rohitkalra)

    finally, I added experience

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘wp job manager add experience field’ is closed to new replies.