My Query is getting the wrong data

$the_args = array (
    'post_type' => 'jobs',
    the_field('job_category') 
);

The trouble here is that the_field( 'job_category' ) prints data, so using it to build an array is pretty much useless. You’re left with literally post_type = job.

However, the real problem is that you actually need to grab the category options, not the posts that you attach them to. That’s why, when you run your loop, you just end up with a select that corresponds to each post’s category.

A quick gander at the ACF documentation reveals…

$field = get_field_object('field_name');
$value = get_field('field_name');
$label = $field['choices'][ $value ];

This gives us a pretty clear idea of how to interact with data stored by ACF. $field['choices'] appears to be an associative array of the choices (categories), the key being the “field” & the value being the “label”. With this info, let’s have a crack at building that select:

<?php if ( $field = get_field_object( 'job_category' ) ) : ?>
    <select name="job_cats">
        <?php foreach ( $field['choices'] as $name => $label ) ?>
            <option value="<?php echo $name ?>"><?php echo esc_html( $label ) ?></option>
        <?php endforeach ?>
    </select>
<?php endif ?>

Hope this helps, and let us know if you’re unsure of anything, or if it doesn’t work! 🙂