Support

Account

Home Forums General Issues Select field

Helping

Select field

  • How do you use this in your template? I want a select box to appear on my page, with some choices that a person can pick, but I don’t see how it can be used.

    my select ACF field label is “pickregion”

    I created a select box and I have the code in my template

    <?php echo apply_filters('the_content', get_field('pickregion')); ?>

  • Hi @Deelite

    ACF offers many functions to interact with your data.
    Normally, you would load the selected value like this:

    
    $value = get_field('field_name');
    

    If you want to actually ‘create’ a select input, then you can use a function called create_field like so:

    
    $field = get_field_object('pickregion');
    create_field($field);
    

    The code you posted (the_content) has nothing to do with creating a select field. May I ask where you found this code, and why you posted it above?

    Thanks
    E

Viewing 2 posts - 1 through 2 (of 2 total)

The topic ‘Select field’ is closed to new replies.