Support

Account

Home Forums ACF PRO Not all fields producing data

Solving

Not all fields producing data

  • I have one field in my field group that does no produce any data on the front end. What’s strange is all of the field data is put in the CPT / database. I can see the data in the CPT on the backend, nothing on the frontend though.

    The problem field is number_povs, all the other fields work fine on the frontend and backend.

    This is my field group config: FieldGroup

    This is my form code.

    <?php
    /**
    	Template Name: New POV Travel Full Width
    
    	Description: A page template without the left or right columns
    	@package flat_responsive
    	@since 1.0.0
     */
    acf_form_head(); 
    get_header(); ?>
    <section id="fr-content-area" class="fr-contents" role="main">
        <div class="container">
            <div class="row"> 
            	<div class="col-md-9">
    	<?php while ( have_posts() ) : the_post(); ?>
    				
    	<h2><?php the_title(); ?></h2>
    	
    <!--- Displays the data submitted through the form --->
    <?php
    	$current_user = wp_get_current_user();
    	if ( 0 == $current_user->ID ) {
    		// Not logged in.
    		echo '<h4>** You must be logged in to use this calculator. **</h4>';
    		echo 'Membership is free. <br/>
    		Register <a href="http://www.pcscalculator.com/wp-login.php?action=register">here</a>.</br>
    		Login <a href="http://www.pcscalculator.com/wp-login.php">here</a>.
    		';
    	
    	} else {
    		
    		// The Form Data
    		$dla = get_field('dla');
    		$miles = get_field('miles');
    
    		// Number of POVs driven
    		$povs = get_field('number_povs');
    
    		
    
    		if(!isset($_GET['updated'])){
    			acf_form(array(
    				'id' => 'POV-Travel',
    				'post_id'		=> 'new_post',
    				'field_groups'	=> array(431),
    				'new_post'		=> array(
    					'post_type'		=> 'pov_travel',
    					'post_status'	=> 'publish'),
    				'submit_value'		=> 'Submit',
    			));
    		} else {
    			// 
    			echo '<Strong>DISLOCATION ALLOWANCE</strong><br/>';
    			echo "DLA rate: $".$dla."<br/><br/>";
    		  
    			echo '<Strong>AUTHORIZED TRAVEL TIME</strong><br/>';
    			echo "Miles entered = " .$miles." miles<br/>";
    			
    			echo '<Strong>MALT (Monetary Allowance in Lieu of Transportation)</strong><br/>';
    			echo 'Mileage = '.$mileage.'<br/>';
    			echo 'Number of POVs = '.$povs.'<br/>';
    		}	
    	}											
    ?>
    <!--- Displays the data submitted through the form -->
    	<?php endwhile; //End the Loop ?>
    			
    		  </div>
    		</div>
    	</div>
    </section>
    
    <?php get_footer(); ?>

    Thus far, I have renamed the field, deleted it and re-created it with another name… still nothing.

    Am I missing something in the code?

  • Hi @signalwarrant

    I’m afraid I couldn’t find anything wrong with your code. Is it possible that you use a cache plugin? If you use it, could you please delete the cache and test it again using the private or incognito mode on your browser? Also, could you please try to reproduce the issue on one of the WordPress’ stock themes (like Twenty Sixteen) with other plugins deactivated? If it disappears, then you can activate the theme and plugins one by one to see which one causes the issue.

    If the issue persists, could you please open a new ticket and provide temporary admin credentials to your site? You can open a new ticket here: https://support.advancedcustomfields.com/new-ticket. Don’t forget to explain the issue again or provide the link to this thread.

    Thanks 🙂

  • James,

    I’m out of troubleshooting ideas, I just submitted the support ticket.

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

The topic ‘Not all fields producing data’ is closed to new replies.