<?php if(the_field('direccion_clases')) { echo '<p>Dirección clases:' . $direccion_clases . '</p>'; } ?>
<?php if ( function_exists('get_field') && get_field('direccion_clases') ) { echo '<p>Direcci\ón clases:' . get_field('direccion_clases') . '</p>'; } ?>
I´m using Advanced Custom Fields on a wordpress site and I need help with this:
What I should do to get the field only if is available and if is not show nothing???.
Here is my code but is not working:
Thanks.
Remember, the_field() is already 'echoed', much like the_content() and the_permalink().
get_field() gets the value without echoing.
Glad you're using it!
www.apky.cl