<?php
/*
Template Name: Video Detail
*/
?>

<?php get_header(); ?>

<!-- Row for main content area -->
	<div class="small-12 large-8 columns" id="content" role="main">

<?php /* Initiate the Pods Object */

    // get the current slug
    global $post;

  	// get pods object
    // $post->post_type can be used instead of the pod name, ie 'video'
  	$mypod = pods( $post->post_type, $post->ID );

    $video = $mypod->id();
    $title = $mypod->display('title');
  	$permalink = $mypod->display('permalink');
    $imagehtml = get_the_post_thumbnail( $video, 'thumb', array( 'class' => 'thumbnail' ));


?>
		<article>
			<header>
				<h1 class="entry-title">
          <a href="<?php echo esc_url($permalink); ?>" title="<?php echo esc_attr($title); ?>"><?php echo $title; ?></a>
        </h1>
        <div class="entry-thumb"><?php echo $imagehtml; ?></div>

				<?php
				/* Add Taxonomy */

				$genres = get_the_term_list($post->ID,'genre',"Categories: ", " / ","");
				?>
        <p class="categories"><?php echo $genres; ?></p>

			</header>
			<div class="entry-content">
      <?php
      /* Output the Actors */
      /* not sorted */
      /* $actors = $mypod->field('related_actors'); */

      /* This is is an array, so must be field;
         if you're doing local, print_r will let you see the keys of the array
      */

      /* Build Param for sorting Actors */
      $param = array( 'orderby' => 't.post_title ASC' );
      $actors = $mypod->field('related_actors', $param);
      if (! empty( $actors )) { ?>

        <h3>Actors in Movie:</h3>
        <ul id="actor-list">
        <?php
          foreach ( $actors as $actor ) {
            $id = $actor[ 'ID' ];
            $title = $actor[ 'post_title' ];
            echo '<li><a href="' .esc_url(get_permalink( $id )). '">' .get_the_title( $id ). '</a></li>';
          }
          echo '</ul>';
        }
        ?>

			</div>
			<footer>
			</footer>
		</article>


		<?php comments_template(); ?>

	</div>
	<?php get_sidebar(); ?>

<?php get_footer(); ?>

 

Questions