Advertisement
Guest User

Gal Wpsite

a guest
Jun 17th, 2014
641
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.68 KB | None | 0 0
  1. <?php
  2. /**
  3.  * The Template for displaying all single posts
  4.  *
  5.  * @package WordPress
  6.  * @subpackage Twenty_Twelve
  7.  * @since Twenty Twelve 1.0
  8.  */
  9.  
  10. get_header(); ?>
  11.  
  12.     <div id="primary" class="site-content">
  13.         <div id="content" role="main">
  14.        
  15.     <?php
  16.         $myPods = pods("pods_video",get_the_id()); // this is our pods object
  17.  
  18.         $video_url = $myPods->field("video_url"); //gets the field "video url"
  19.         $video_url = str_replace('https://www.youtube.com/watch?v=', '', $video_url); // remove the addres
  20.         $video_embed= '<object width="560" height="315"><param name="movie" value="//www.youtube.com/v/'.$video_url.'?version=3&amp;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&amp;hl=iw_IL" type="application/x-shockwave-flash" width="560" height="315" allowscriptaccess="always" allowfullscreen="true"></embed></object><br>';
  21.  
  22.         echo "<h1>".$myPods->field("title")."</h1>"; //post the title
  23.         echo $video_embed; //post the video
  24.         echo $myPods ->field("video_desc"); //post the descripton
  25.  
  26.         $nextPod = pods("pods_video",$myPods -> next_id($myPod->id)); // get the next pod
  27.         $prevPod = pods("pods_video",$myPods -> prev_id($myPod->id)); // get the previous pod
  28.  
  29.         if ($prevPod->id) //check if there is a previous pod
  30.             echo '<br><a href="'.$prevPod->field("permalink").'">'.$prevPod->field("title").'</a><br>';
  31.         if ($nextPod->id) //check if there a next pod
  32.             echo '<a href="'.$nextPod->field("permalink").'">'.$nextPod->field("title").'</a>';
  33.         ?>
  34.            
  35.  
  36.         </div><!-- #content -->
  37.     </div><!-- #primary -->
  38.  
  39. <?php get_sidebar(); ?>
  40. <?php get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement