Created
July 31, 2015 00:35
-
-
Save jimtrue/3f035a4c836834bf7c1a to your computer and use it in GitHub Desktop.
Single Actor Example Pods API Theme File
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
Template Name: Actor 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 | |
/* $slug = pods_v( 'last', 'url' ); */ | |
global $post; | |
// get pods object | |
$mypod = pods( $post->post_type, $post->ID ); | |
$actor = $mypod->id(); | |
$title = $mypod->display('title'); | |
$permalink = $mypod->display('permalink'); | |
$videos = $mypod->field('related_videos'); | |
?> | |
<article> | |
<header> | |
<h1 class="entry-title"> | |
<a href="<?php echo $permalink; ?>"><?php echo $title; ?></a> | |
</h1> | |
</header> | |
<div class="entry-content"> | |
<?php /* Output the Movies */ | |
if (! empty( $videos )) { ?> | |
<h3>Movies:</h3> | |
<ul id="movie-list"> | |
<?php | |
foreach ( $videos as $video ) { | |
$id = $video[ 'ID' ]; | |
echo '<li><a href="' .get_permalink( $id ). '">' .get_the_title( $id ). '</a></li>'; | |
} | |
} | |
?> | |
</div> | |
<footer> | |
</footer> | |
</article> | |
<?php comments_template(); ?> | |
</div> | |
<?php get_sidebar(); ?> | |
<?php get_footer(); ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment