Support

Account

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(); ?>