Support

Account

Home Forums General Issues get_field(); SoundCloud

Helping

get_field(); SoundCloud

  • Dear forum!
    I am looking for a way to not display a field’s placeholder when it’s empty. I am having this code for image fields:

    <?php 
    $image = get_field('image');
    if( !empty( $image ) ): ?>
        <img src="<?php echo esc_url($image['url']); ?>" alt="<?php echo esc_attr($image['alt']); ?>" />
    <?php endif; ?>

    But I want to achieve the same for a field which contains a SoundCloud link.
    Is this somehow doable?

    Any hints would be really appreciated!

Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.