• Resolved rish30990

    (@rish30990)


    By default job archive page shows only “Location” and “Job type”. But I want different fields in archive page, So I decided to create custom loop for this using wp_query. For that How can I fetch values of other fields? i.e. I want to fetch value of “Experience” field with any wordpress function in my custom loop, how can I do that?

Viewing 1 replies (of 1 total)
  • Thread Starter rish30990

    (@rish30990)

    Ok I figured it out, I used “get_post_meta()” function to fetch values like this

    $post_id = get_the_ID();
    $job_experience = get_post_meta($post_id, 'position_experienceRequirements', true);
    $job_location = get_post_meta($post_id, 'position_job_location', true);

    Here “position_experienceRequirements” and “position_job_location” are main IDs (css id) of content area of field which I found on editor page using inpection tool. Those IDs are mata keys as well.

    • This reply was modified 6 years, 10 months ago by rish30990.
    • This reply was modified 6 years, 10 months ago by rish30990.
Viewing 1 replies (of 1 total)
  • The topic ‘How can I add fields value in custom loop using wp_query?’ is closed to new replies.