Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- * The template for displaying Archive pages
- *
- * Used to display archive-type pages if nothing more specific matches a query.
- * For example, puts together date-based pages if no date.php file exists.
- *
- * If you'd like to further customize these archive views, you may create a
- * new template file for each specific one. For example, Twenty Twelve already
- * has tag.php for Tag archives, category.php for Category archives, and
- * author.php for Author archives.
- *
- * @link http://codex.wordpress.org/Template_Hierarchy
- *
- * @package WordPress
- * @subpackage Twenty_Twelve
- * @since Twenty Twelve 1.0
- */
- get_header(); ?>
- <section id="primary" class="site-content">
- <div id="content" role="main">
- <?php
- $params= array (
- "limit" => 5
- );
- $myPods = pods('pods_video',$params);
- echo "<ul>";
- if ($myPods -> total() > 0) {
- while ($myPods->fetch()) {
- $video_img = pods_image_url($myPods->field("video_img"));
- $video_url = $myPods -> field ("video_url");
- if ($video_img == '') {
- $temp_video_url = $video_url;
- $temp_video_url = str_replace('https://www.youtube.com/watch?v=', '',$temp_video_url);
- $video_img = 'http://i.ytimg.com/vi/'.$temp_video_url.'/0.jpg';
- }
- echo "<li style='text-align:center;' >";
- echo "<a href=".$myPods -> field("permalink").">";
- echo "<img src='".$video_img."'style ='width:150px; margin:20px 0;'/>";
- echo "<h2>".$myPods->field("title")."</h2></a>";
- echo "</li>";
- }
- }
- echo "</ul>";
- ?>
- </div><!-- #content -->
- </section><!-- #primary -->
- <?php get_sidebar(); ?>
- <?php get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement