Support

Account

Home Forums Front-end Issues Display only field with a content + add code inside a field Reply To: Display only field with a content + add code inside a field

  • There really are not any tutorials here on basic template coding for WP.

    Once you have that figured out then showing a field only when it has content is simple.

    For example:
    <strong>PROPRIETARIO:</strong> [acf field="proprietario"]
    in PHP becomes

    
    if (get_field('proprietario')) {
      ?><strong>PROPRIETARIO:</strong> <?php the_field('proprietario'); ?><br />
    }
    

    These types of examples for fields can be found in the documentation for each field type.

    Another option would be to build your own shortcode. There are a lot of tutorials on the web for how to built custom shortcodes

    ShortcodesUltimate has a shortcode creator add on to create shortcodes without messing with theme files https://getshortcodes.com/add-ons/shortcode-creator/