Support

Account

Home Forums Front-end Issues True/false field fron function.php

Helping

True/false field fron function.php

  • I have some true / false fields of a card, inserting the php code in the template of the page no problem I customized html in order to make an icon and text appear in my template. Instead, I need to use a plugin to insert the php code via function.php so that the fields take that formatting directly without inserting them in the template, is it possible ??

    This is a snippet of my code used in the template

    <?php if ( get_field( 'piscina' ) ): ?>
    
    <div>
      
      <i class="fas fa-swimmer servizi2 iconaserv"></i>
      <p class="servizi2 pad">Piscina
    
    </div>
    				
    				<?php else: // field_name returned false ?>
    
    			
    
    				<?php endif; // field_name ?>
  • Look at the acf/format_value filter https://www.advancedcustomfields.com/resources/acf-format_value/ Use a priority >10 for your filter so that it runs after the built in filter.

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

You must be logged in to reply to this topic.