Support » Fixing WordPress » How can i fix this error

  • TataVostru


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

    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; ?>

    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.