• Im interesting what meta value to add in WP Job Manager, so the avatar photo url link to show automatically in the field for that?

    For the text fields i add
    ‘value’ => metadata_exists( ‘post’, $post->ID, ‘_application’ ) ? get_post_meta( $post->ID, ‘_application’, true ) : $current_user->display_name,

    and its work, but im stuck on the photo url.

Viewing 1 replies (of 1 total)
  • Here is the code I used to add an image to each listing in job manager if it’s any help for you. Add to your theme’s functions.php file.

    /* Add image to listing */
    add_filter( ‘submit_job_form_fields’, ‘frontend_add_featured_image’ );
    function frontend_add_featured_image( $fields ) {
    $fields[‘job’][‘job_image’] = array(
    ‘label’ => __( ‘Image’, ‘job_manager’ ),
    ‘type’ => ‘file’,
    ‘required’ => true,
    ‘placeholder’ => ”,
    ‘priority’ => 7
    );
    return $fields;
    }

    /* Save input */
    add_action( ‘job_manager_update_job_data’, ‘frontend_add_featured_image_save’, 10, 2 );
    function frontend_add_featured_image_save( $job_id, $values ) {
    update_post_meta( $job_id, ‘_job_image’, $values[‘job’][‘job_image’] );
    }

    /* Add Custom Field to WP Admin Section */
    add_filter( ‘job_manager_job_listing_data_fields’, ‘admin_add_job_image_field’ );
    function admin_add_job_image_field( $fields ) {
    $fields[‘_job_image’] = array(
    ‘label’ => __( ‘Image’, ‘job_manager’ ),
    ‘type’ => ‘file’,
    ‘placeholder’ => ”,
    ‘description’ => ”
    );
    return $fields;
    }

    And then just add this wherever you want to display the image:

    <img src=”<?php echo $post->_job_image; ?>” alt=””>

Viewing 1 replies (of 1 total)
  • The topic ‘How to add meta value’ is closed to new replies.