Support

Account

Home Forums Front-end Issues Relationship fields not loading in front end form

Helping

Relationship fields not loading in front end form

  • Hello,

    I am trying to build a front-end form to let the user create a new Custom Post (of the type “reservations”), here is the code I have put in my template file:

    
    <?php
    /**
     * Template Name: MyTemplate
     */?>
    
     			<br><br><br><br>
    
    			<?php /* The loop */ ?>
    			<?php while ( have_posts() ) : the_post(); ?>
    				
    
    				<?php  $options = array('post_id' => 'new',
    						'field_groups' => array('group_59a5e28926a1e'),
    						'post_title'	=> true,
    						'post_type'		=> 'reservations',
    						'post_status'	=> 'draft',
    						'submit_value'	=> 'Postez votre recette'
    		);
    				 acf_form($options);?>
    
    			<?php endwhile; ?>

    And here is how it is displayed:

    rien

    “Chambre” and “Évènement” are two relationship fields (that correspond to “Chambre” and “Évènement” custom post types respectively).

    I have no idea where this problem comes from. I have checked the firefox console, and I see no error.

    Thank you

  • If the values do not load there is either an error in JavaScript or an error in PHP during hte AJAX request.

    This can also be cause by not calling acf_form_head().

    JavaScript errors are usually caused by plugin conflicts. To begin debugging this start disabling other plugins to see if you can clear it up.

    PHP errors during AJAX can be found by enabling error logging https://codex.wordpress.org/WP_DEBUG

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

The topic ‘Relationship fields not loading in front end form’ is closed to new replies.