Advertisement
darrenbachan

Untitled

Jun 9th, 2016
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.46 KB | None | 0 0
  1. <?php
  2.                                 $consoles = wp_get_object_terms( $post->ID,  'consoles' );
  3.                                 $separator = ", ";
  4.                                 $output = '';
  5.  
  6.                                 if ( ! empty( $consoles ) ) {
  7.                                     if ( ! is_wp_error( $consoles ) ) {
  8.                                         echo '<li><span>Platforms:</span> ';
  9.                                             foreach( $consoles as $term ) {
  10.                                                 $output .= esc_html( $term->name ) . $separator;
  11.                                             } echo trim($output, $separator);
  12.                                         echo '</li>';
  13.                                     }
  14.                                 }
  15.                                 ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement