Advertisement
Guest User

Gal Wpsite

a guest
Jun 17th, 2014
453
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.63 KB | None | 0 0
  1. <?php
  2. /**
  3.  * The template for displaying Archive pages
  4.  *
  5.  * Used to display archive-type pages if nothing more specific matches a query.
  6.  * For example, puts together date-based pages if no date.php file exists.
  7.  *
  8.  * If you'd like to further customize these archive views, you may create a
  9.  * new template file for each specific one. For example, Twenty Twelve already
  10.  * has tag.php for Tag archives, category.php for Category archives, and
  11.  * author.php for Author archives.
  12.  *
  13.  * @link http://codex.wordpress.org/Template_Hierarchy
  14.  *
  15.  * @package WordPress
  16.  * @subpackage Twenty_Twelve
  17.  * @since Twenty Twelve 1.0
  18.  */
  19.  
  20. get_header(); ?>
  21.  
  22.     <section id="primary" class="site-content">
  23.         <div id="content" role="main">
  24.     <?php
  25.  
  26.         $params= array (
  27.             "limit" => 5
  28.             );
  29.         $myPods = pods('pods_video',$params);
  30.         echo "<ul>";
  31.        
  32.         if ($myPods -> total() > 0) {
  33.             while ($myPods->fetch()) {
  34.                 $video_img  = pods_image_url($myPods->field("video_img"));
  35.                 $video_url = $myPods -> field ("video_url");
  36.                 if ($video_img == '') {
  37.                     $temp_video_url = $video_url;
  38.                     $temp_video_url = str_replace('https://www.youtube.com/watch?v=', '',$temp_video_url);
  39.                     $video_img = 'http://i.ytimg.com/vi/'.$temp_video_url.'/0.jpg';
  40.                 }
  41.                 echo "<li style='text-align:center;' >";
  42.                 echo "<a href=".$myPods -> field("permalink").">";
  43.                 echo "<img src='".$video_img."'style ='width:150px; margin:20px 0;'/>";
  44.                 echo "<h2>".$myPods->field("title")."</h2></a>";
  45.                 echo "</li>";
  46.             }
  47.  
  48.         }
  49.  
  50.         echo "</ul>";
  51.         ?>
  52.  
  53.  
  54.         </div><!-- #content -->
  55.     </section><!-- #primary -->
  56.  
  57. <?php get_sidebar(); ?>
  58. <?php get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement