Advertisement
Guest User

Untitled

a guest
Oct 29th, 2012
192
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 5.61 KB | None | 0 0
  1. <?php
  2. /*
  3. Template Name: Blog 3
  4. */
  5. get_header();
  6. ?>
  7.  
  8. <?php while ( have_posts() ) : the_post(); ?>
  9. <?php
  10. $subtitle = get_post_meta(get_the_ID(), BRANKIC_VAR_PREFIX."subtitle", true);
  11. $hide_title = get_post_meta(get_the_ID(), BRANKIC_VAR_PREFIX."hide_title", true);
  12. $centered_title = get_post_meta(get_the_ID(), BRANKIC_VAR_PREFIX."centered_title", true);
  13. $select_blog_category = get_post_meta(get_the_ID(), BRANKIC_VAR_PREFIX."select_blog_category", true);
  14. $sidebar = get_post_meta(get_the_ID(), BRANKIC_VAR_PREFIX."select_sidebar", true);
  15.  
  16.  
  17. if ($hide_title != "yes")
  18. {
  19. ?>
  20.     <div class="section-title">
  21.    
  22.         <h1 class="title"><?php the_title(); if ($subtitle != "") { ?> <span><?php echo $subtitle; ?></span><?php } ?></h1>
  23.                        
  24.     </div><!--END SECTION TITLE-->
  25. <?php
  26. }
  27. ?>  
  28.  
  29. <?php
  30. if ($centered_title != "")
  31. {
  32. ?>
  33.     <div class="section-title text-align-center">
  34.    
  35.         <h1 class="title"><?php echo $centered_title; ?></h1>
  36. <?php if ($subtitle != "") { ?> <p><?php echo $subtitle; ?></p><?php } ?>
  37.                        
  38.     </div><!--END SECTION TITLE-->
  39. <?php
  40. }
  41. ?>
  42.     <div id="inner-content" class="blog3">
  43.     <?php
  44.     the_content();
  45.     ?>
  46. <?php
  47.     $args=array(
  48.     'cat' => $select_blog_category,
  49.     'orderby' => 'date',
  50.     'order' => 'DESC',
  51.     'paged' => $paged
  52.     );
  53.     $temp = $wp_query;
  54.     $wp_query = new WP_Query( $args );
  55.  
  56. // The Loop
  57. while ( $wp_query->have_posts() ) : $wp_query->the_post();
  58. $featured_image_array = wp_get_attachment_image_src( get_post_thumbnail_id(), 'blog-square' );
  59. $featured_image = $featured_image_array[0];
  60. ?>
  61.  
  62.             <div class="post">
  63.            
  64.                 <div class="post-info">                        
  65.                     <div class="date"><span class="month"><?php the_time('M'); ?></span><span class="day"><?php the_time('d'); ?></span><span class="month"><?php the_time('Y'); ?></span></div>                    
  66.                     <div class="comments"><?php comments_popup_link('<span>0</span> Kommen-
  67.                     tarer', '<span>1</span> Kommentar', '<span>%</span> Kommen-
  68.                     tarer'); ?></div>                            
  69.                 </div><!--END POST-INFO-->          
  70.            
  71.                 <div class="post-media">
  72.                 <?php
  73.                     $video_link = get_post_meta(get_the_ID(), BRANKIC_VAR_PREFIX."video_link", true);
  74.  
  75.                     if ($video_link != "")
  76.                     {
  77.                         if (bra_is_mov($video_link) || bra_is_swf($video_link))
  78.                         {
  79.                         ?>
  80.                         <iframe src="<?php echo $video_link; ?>" width="100%" height="200" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>
  81.                         <?php
  82.                         }
  83.                         if (bra_is_vimeo($video_link) || bra_is_youtube($video_link))
  84.                         {
  85.                             if (bra_is_vimeo($video_link))
  86.                             {
  87.                                 $video_link = "http://player.vimeo.com/video/" . bra_get_vimeo_id($video_link);
  88.                             }
  89.                             if (bra_is_youtube($video_link))
  90.                             {
  91.                                 $video_link = "http://www.youtube.com/embed/" . bra_get_youtube_id($video_link);
  92.                             }
  93.                             ?>
  94.                             <iframe src="<?php echo $video_link; ?>" width="100%" height="200" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>
  95.                             <?php
  96.                         }
  97.                     }
  98.                     else
  99.                     {
  100.                     ?>
  101.                         <?php if (extra_images_exists()) { include ("slider.inc.3.php"); } else { ?>        
  102.                         <a href="<?php the_permalink(); ?>"><img src="<?php echo $featured_image; ?>" alt="" width="270" height"270" /></a>
  103.                         <?php } ?>
  104.                     <?php } ?>
  105.                 </div><!--END POST-MEDIA-->
  106.                
  107.                 <div class="post-content">
  108.                    
  109.                     <div class="post-title">                
  110.                         <h2 class="title"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
  111.                     </div><!--END POST-TITLE-->
  112.                
  113.                     <div class="post-meta">                
  114.                         <ul>
  115.                             <li><span><?php _e('Inlagt av', BRANKIC_THEME_SHORT); ?></span> <?php the_author_link(); ?></li>
  116. <?php if (get_option(BRANKIC_VAR_PREFIX."show_cats_blog_page") == "yes") { ?><li><span><?php _e('i', BRANKIC_THEME_SHORT); ?></span> <?php the_category(', '); ?></li><?php } ?>
  117. <?php if (get_option(BRANKIC_VAR_PREFIX."show_tags_blog_page") == "yes") { ?><li><span><?php _e(' Taggad med', BRANKIC_THEME_SHORT); ?></span> <?php the_tags('', ', ', ''); ?></li><?php } ?>
  118.                         </ul>
  119.                     </div><!--END POST-META-->    
  120. <?php
  121. the_excerpt();
  122. ?>
  123. <p><a href="<?php the_permalink(); ?>" class="more-link"><?php _e('Fortsätt läsa &rarr;', BRANKIC_THEME_SHORT); ?></a></p>
  124.                 </div><!--END POST-CONTENT -->
  125.                
  126.             </div><!--END POST-->
  127. <?php
  128. endwhile;
  129. if(function_exists('wp_pagenavi_bra')) { wp_pagenavi_bra(); }  
  130. ?>  
  131.        
  132.         </div><!--END INNER-CONTENT-->
  133. <?php
  134.  
  135. get_sidebar();
  136.  
  137. $wp_query = $temp;  //reset back to original query
  138. ?>
  139.  
  140. <?php endwhile; // end of the loop. ?>     
  141. <?php get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement