title: How to add "else" to "foreach"?
body: <p>i don't know how to add <code>else</code> to <code>foreach</code>!</p>
  
  <p>here is my code:</p>
  
  <pre><code>&lt;?php $terms = get_the_terms( $post-&gt;ID , 'actor' ); 
      foreach ( $terms as $term ) {
          $term_link = get_term_link( $term, 'actor' );
          if( is_wp_error( $term_link ) )
          continue;
          echo '&lt;a href="' . $term_link . '"&gt;' . $term-&gt;name . '&lt;/a&gt;';
      }
  ?&gt;
  </code></pre>