• Resolved TataVostru

    (@tatavostru)


    hy i have the code:

    <?php if(get_field('trailere_filme') != ""){foreach(get_field('trailere_filme') as $post_object): ?>
    <div class="box-trailere">
    <div class="trailer-img">
    <a href="<?php echo get_permalink($post_object->ID); ?>" rel="bookmark" title="<?php printf(__('Trailer film %s', 'kubrick'), the_title_attribute('echo=0')); ?>">
    <span class="tip"><?php echo get_field( 'tip', $post_object->ID ); ?></span>
    <span class="trai-hov"></span>
    <img src="https://img.youtube.com/vi/<?php echo get_field( 'trailer', $post_object->ID ); ?>/<?php echo get_field( 'img_trailer', $post_object->ID ); ?>" alt="Trailer <?php echo get_the_title($post_object->ID) ?>" title="Trailer <?php echo get_the_title($post_object->ID) ?>"></a>
    <span class="duration"><?php echo get_field( 'time', $post_object->ID ); ?></span>
    </div>
    <span class="trailer-title"><a href="<?php echo get_permalink($post_object->ID); ?>" title="Trailer <?php echo get_the_title($post_object->ID) ?>"><?php echo get_the_title($post_object->ID) ?></a></span>
    </div>
    <?php endforeach;}?>

    When i dont put annyting in the custom field box, it wont apear nothing, i want to apear.. a text someting like…

    “There are no trailers for this movie”

    I hope you understand.
    Thanks

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Display the text – No content’ is closed to new replies.