Support

Account

Home Forums Front-end Issues acf_form checkbox field display problem

Solved

acf_form checkbox field display problem

  • Hi all, i am facing a (probably) very easytofix issue, but i am unfortunately unable to solve it myself.

    I am using acf_form to create a new post on one of my pages, and i am telling the form to show fields from field group that includes text, select and checkbox values.
    The issue is that text and select fields are displayed correctly (s text and dropdowns) but checkbox fields are displays as bulleted lists. If i click on the values and click submit – it actually saves the value as checked, together with making a new post, so the functionality is working. But still, checkboxes should be displayed as checkboxes, not lists.

    Does anyone know how to fix this issue?

    Here’s my simple code:

    <?php 
    $args = array(
            'post_id' => 'new',
            'field_groups' => array(300),
        );   
    acf_form( $args );
    ?>
  • ah, yes, forgot to mention – it’s at the very top of the file, before the get_header();

  • update:

    solved the issue by placing the acf_form_head() right before the acf_form() function, which is way below the get_header(). Probably something in my theme that broke the styling if acf_form_head() is above the get_header(). Thanks.

  • acf_form_head will not work correctly there, it needs to be placed before html is output. I thought it might be styles in the theme but I wanted to start with the most likely thing first. It would be hard to say how to fix this anyway. You could try giving the theme styles a lower priority to try to force them to be loaded first.

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

The topic ‘acf_form checkbox field display problem’ is closed to new replies.