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/
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.