Home › Forums › Front-end Issues › How to show ACF Repeater in front end form › Reply To: How to show ACF Repeater in front end form
@madhan2085
Your template doesn’t look right!
I’ve removed the script as I assume you’re not using ajax.
Also, you don’t need the form declared in the loop
Finally, you’re using a user ID as the post ID but not declaring the user ID:
<?php
/**
* Template Name: Manage Products
*
* @package Listable
* @since Listable 1.0
*/
acf_form_head();
get_header();
global $post; ?>
<div id="primary" class="content-area">
<main id="main" class="site-main" role="main">
<?php
acf_form(array(
‘form’ => true,
‘post_id’ => ‘user_’ . $user_id, #where is this being declared?
‘field_groups’ => array(‘field_57aad46f04ccc’),
));
?>
</main><!-- #main -->
</div><!-- #primary -->
<?php
get_footer();
If this is storing against a user, you also need to get the logged in user ID, maybe this might work for you:
<?php
/**
* Template Name: Manage Products
*
* @package Listable
* @since Listable 1.0
*/
acf_form_head();
get_header();
global $post;
$user_id = get_current_user_id();
?>
<div id="primary" class="content-area">
<main id="main" class="site-main" role="main">
<?php
acf_form(array(
‘form’ => true,
‘post_id’ => ‘user_’ . $user_id, #where is this being declared?
‘field_groups’ => array(‘field_57aad46f04ccc’),
));
?>
</main><!-- #main -->
</div><!-- #primary -->
<?php
get_footer();
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
❓Ever wondered when and why ACF uses JSON instead of the database? Check out our summary of the most recent session of ACF Chat Friday for the answer, and make sure to register for the next session.
— Advanced Custom Fields (@wp_acf) February 23, 2023
👉 https://t.co/3UtvQbDwNmhttps://t.co/wfFEVcXVKc
© 2023 Advanced Custom Fields.
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Cookie Policy. If you continue to use this site, you consent to our use of cookies.