Support » Fixing WordPress » How can i fix this error

  • Hy,
    i’m building a cinema website, i get an error if there is no content,

    http://www.diviziatm.ro/1.jpg

    In the website i get this if i have no content:

    Warning: Invalid argument supplied for foreach() in /home/cinema/public_html/cinema/wp-content/themes/movies/tabfilm/detali-film.php on line 25

    My code for display scenarist is under:

    <span class="film"><b>Scenarist</b><br />
    <?php foreach(get_field('scenaristi') as $post_object): ?>
    <a class="arh-link" href="<?php echo get_permalink($post_object->ID); ?>">
    <?php echo get_the_title($post_object->ID) ?></a><br /> <?php endforeach; ?>
    </span>

    For example: if i do not want to display something, i wish to apear the text: No actors.

    Thanks. Excuse my english

Viewing 15 replies - 16 through 30 (of 33 total)
Viewing 15 replies - 16 through 30 (of 33 total)
  • The topic ‘How can i fix this error’ is closed to new replies.