Home › Forums › Front-end Issues › How do I render a checkbox field on the frontend › Reply To: How do I render a checkbox field on the frontend
HI @designer023
Thanks for the post.
To render fields in the frontend you will need to make use of the acf_form() and the acf_form_head() functions within your template.
The code would like so:
<?php acf_form_head(); ?>
<?php get_header(); ?>
<div id="primary" class="content-area">
<div id="content" class="site-content" role="main">
<?php /* The loop */ ?>
<?php while ( have_posts() ) : the_post(); ?>
<?php acf_form(array(
'post_id' => 123,
'post_title' => false,
'fields' => array(field_fd152627e),
'submit_value' => 'Update the post!'
)); ?>
<?php endwhile; ?>
</div><!-- #content -->
</div><!-- #primary -->
<?php get_sidebar(); ?>
<?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!
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 Privacy Policy. If you continue to use this site, you consent to our use of cookies.