Support

Account

Home Forums Front-end Issues Certain field values not appearing in the post when the category is changed

Solved

Certain field values not appearing in the post when the category is changed

  • I am not a developer and only have basic understanding of WordPress and PHP, but due to the user-friendliness and a helpful community, I was able to set up a WordPress site with ACF fields. It has worked flawlessly, years ago, before the update.

    After the update, the custom fields and the template values disappeared, and I was able to set up again.

    However, now I am encountering another problem. The template works well but only when the default post category is selected. Once I change the post category, specific fields suddenly disappear from the template. The rest are still there, only the ones in the middle disappear.

    Here is my template code:

    <div class="vw-post-content clearfix">					
    <table class="table table-condensed">									
    <tbody>		
      <tr>											
         <td width="30%">Location:</td>  <td><?php the_field('location'); ?></td>
      </tr>																											
      <tr>										
         <td width="30%">Property Type:</td>
         <td> <?php the_field('property_type'); ?>, <?php the_field('number_of_buildings'); ?> buildings, <?php the_field('number_of_floors'); ?> floors
         </td>									
      </tr>
      <tr>
         <td width="30%">Development Stage:</td>
         <td><?php the_field('development_stage'); ?></td>
      </tr>
      <tr>
         <td width="30%">Building Completion Date(s):</td>											 
         <td><?php the_field('building_completion_dates'); ?></td>
      </tr>
    </tbody>
    </table>														
    							
    <?php the_content(); ?>
    							
    <!-- Location Groupset -->																								
    <h2 class="dmci"><i class="icon-iconic-location"></i> Location</h2>								
    <hr/>																	
       <div><?php the_field('location_description'); ?></div>																	
    
    <h3>Getting There</h3>
     <div><?php the_field('location_getting_there'); ?></div>																		
    <h3>The Neighborhood</h3>
     <div><?php the_field('location_the_neighborhood'); ?></div>																				
    <h4>Road Network</h4>
     <div><?php the_field('location_road_network'); ?></div>										
    <h4>Business Areas</h4>											
     <div><?php the_field('location_business_areas'); ?></div>									
    <h4>Commercial Areas</h4>											
     <div><?php the_field('location_commercial_areas'); ?></div>										
    <h4>Hospitals</h4>											
     <div><?php the_field('location_hospitals'); ?></div>										
    <h4>Schools</h4>											
     <div><?php the_field('location_schools'); ?></div>										
    <h4>Churches</h4>										
     <div><?php the_field('location_churches'); ?></div>																	
    							
    <!-- Site Development -->																																						
    <h2 class="dmci"><i class="icon-awesome-building"></i> Site Development Plan</h2>								
    <hr/>																	
     <div><?php the_field('site_development_plan'); ?></div>																		
    <h3>Floor Plans</h3>										
     <div><?php the_field('site_floor_plans'); ?></div>																		
    <h3>Outdoor Amenities</h3>
     <div><?php the_field('site_outdoor_amenities'); ?></div>																		
    <h3>Indoor Amenities</h3>										
     <div><?php the_field('site_indoor_amenities'); ?></div>
    <h3>Building Facilities</h3>										
     <div><?php the_field('site_building_facilities'); ?></div>																		
    <h3>Property Management Office</h3>	
     <div><?php the_field('site_pmo'); ?></
    						
    <!-- Payment -->																								
    <h2 class="dmci"><i class="icon-awesome-key"></i> Reservation and Payment Options</h2>								
    <hr/>			
    <h3>Reservation Requirements</h3>
    <div><?php the_field('reservation_requirements'); ?></div>																			
    <h4>Additional Requirements <small class="no-transform">to be submitted upon release of contract to sell</small></h4>										
    <div><?php the_field('additional_requirements'); ?></div>																		
    <h3>Payment Options</h3>
    <div><?php the_field('payment_options'); ?></div>																			
    <h3>Accredited Banks</h3>
    <div><?php the_field('accredited_banks'); ?></div>																								
    </div>

    When I change the category, the “Building Completion Date” and the entire “Location Groupset” fields disappear completely. But the rest of the fields remain.

    The field settings I have are the most basic ones – I have no rules or any special configuration. All the fields are set to “show field group if Post type is equal to Post”, and the template resides in a single custom template. Again, this has worked in the past implementation, before the update.

  • Okay, nevermind, I just figured it out.

    Because I haven’t worked on this website for a while, I completely forgot that the single custom template was assigned to a specific category.

    After searching, I found that the right template was still intact. However, because of the ACF update, the custom fields I had set up in admin disappeared. When I recreated the field groups, I luckily assigned the right names to the fields that showed up, and unfortunately assigned different field names that didn’t show up.

    Hope this would help anyone that encountered this type of problem.

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

The topic ‘Certain field values not appearing in the post when the category is changed’ is closed to new replies.