Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- * The Template for displaying all single posts
- *
- * @package WordPress
- * @subpackage Twenty_Twelve
- * @since Twenty Twelve 1.0
- */
- get_header(); ?>
- <div id="primary" class="site-content">
- <div id="content" role="main">
- <?php
- $myPods = pods("pods_video",get_the_id()); // this is our pods object
- $video_url = $myPods->field("video_url"); //gets the field "video url"
- $video_url = str_replace('https://www.youtube.com/watch?v=', '', $video_url); // remove the addres
- $video_embed= '<object width="560" height="315"><param name="movie" value="//www.youtube.com/v/'.$video_url.'?version=3&hl=iw_IL"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="//www.youtube.com/v/'.$video_url.'?version=3&hl=iw_IL" type="application/x-shockwave-flash" width="560" height="315" allowscriptaccess="always" allowfullscreen="true"></embed></object><br>';
- echo "<h1>".$myPods->field("title")."</h1>"; //post the title
- echo $video_embed; //post the video
- echo $myPods ->field("video_desc"); //post the descripton
- $nextPod = pods("pods_video",$myPods -> next_id($myPod->id)); // get the next pod
- $prevPod = pods("pods_video",$myPods -> prev_id($myPod->id)); // get the previous pod
- if ($prevPod->id) //check if there is a previous pod
- echo '<br><a href="'.$prevPod->field("permalink").'">'.$prevPod->field("title").'</a><br>';
- if ($nextPod->id) //check if there a next pod
- echo '<a href="'.$nextPod->field("permalink").'">'.$nextPod->field("title").'</a>';
- ?>
- </div><!-- #content -->
- </div><!-- #primary -->
- <?php get_sidebar(); ?>
- <?php get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement