1. <?php
  2. #
  3. # rt-theme loop
  4. #
  5. global $args,$content_width,$paged;
  6.  
  7. add_filter('excerpt_more', 'no_excerpt_more');
  8.  
  9. //varialbles
  10. $video_width        = ($content_width   =="960") ? 940 : 606;
  11. $video_height       = ($content_width   =="960") ? 500 : 380;
  12. $image_width        = ($content_width   =="960") ? 940 : 606;
  13. $image_height       = ($content_width   =="960") ? 500 : 380;
  14.  
  15. if ($args) $theQuery = query_posts($args);
  16.  
  17. //get page & post counts
  18. $page_count = get_page_count();
  19. $post_count = $page_count['post_count'];
  20. $postCount  = 0;
  21.  
  22. $hide_author = get_option(THEMESLUG.'_hide_author');
  23. $hide_categories = get_option(THEMESLUG.'_hide_categories');
  24. $hide_dates = get_option(THEMESLUG.'_hide_dates');
  25. $hide_commnent_numbers = get_option(THEMESLUG.'_hide_commnent_numbers');
  26. $show_small_dates= get_option(THEMESLUG.'_show_small_dates');
  27. $date_format = get_option('rttheme_date_format');
  28. if ( have_posts() ) : while ( have_posts() ) : the_post();
  29. ?>
  30.  
  31.  
  32.     <?php
  33.     #
  34.     #   featured images
  35.     #
  36.     $rt_gallery_images          = (get_post_meta( $post->ID, THEMESLUG . "rt_gallery_images", true )) ? get_post_meta( $post->ID, THEMESLUG . "rt_gallery_images", true ) : "";
  37.     $rt_gallery_image_titles    = (get_post_meta( $post->ID, THEMESLUG . "rt_gallery_image_titles", true )) ? get_post_meta( $post->ID, THEMESLUG . "rt_gallery_image_titles", true ) : "";
  38.     $rt_gallery_image_descs         = (get_post_meta( $post->ID, THEMESLUG . "rt_gallery_image_descs", true )) ? get_post_meta( $post->ID, THEMESLUG . "rt_gallery_image_descs", true ) : "";
  39.     $fist_featured_image        = (is_array($rt_gallery_images)) ? find_image_org_path($rt_gallery_images[0]) : "";
  40.     $resize                     = (get_post_meta($post->ID, THEMESLUG.'blog_image_resize', true)) ? true : false;
  41.     $is_old_post                = (get_post_meta($post->ID, THEMESLUG.'is_old_post', true)=="1") ? false : true;
  42.     $crop                   = (get_post_meta($post->ID, THEMESLUG.'blog_image_crop', true)) ? true : false;
  43.     $width                  = (get_post_meta($post->ID, THEMESLUG.'blog_image_width', true)) ? get_post_meta($post->ID, THEMESLUG.'blog_image_width', true) : $image_width;
  44.     $meta_height                = get_post_meta($post->ID, THEMESLUG.'blog_image_height', true);
  45.     $height                     = (!$meta_height && !$crop) ? 10000 : (($meta_height && !$crop) ? $meta_height : ($meta_height && $crop) ? $meta_height : $image_height);
  46.     $img_position               = (get_post_meta($post->ID, THEMESLUG.'featured_image_position', true)) ? get_post_meta($post->ID, THEMESLUG.'featured_image_position', true): "center";
  47.     $post_class_img         = "featured_image_".$img_position;
  48.     $featured_image_usage       = get_post_meta($post->ID, THEMESLUG .'_featured_image_usage', true);  
  49.     $display_gallery_images     = get_post_meta($post->ID, THEMESLUG .'_display_gallery_images', true);    
  50.     $post_format                = !get_post_format() ? "post" : get_post_format();
  51.     $photo_gallery_images_width = (get_post_meta( $post->ID, THEMESLUG . "photo_gallery_images_width", true )) ? get_post_meta( $post->ID, THEMESLUG . "photo_gallery_images_width", true ) : 160;
  52.     $photo_gallery_images_height    = (get_post_meta( $post->ID, THEMESLUG . "photo_gallery_images_height", true )) ? get_post_meta( $post->ID, THEMESLUG . "photo_gallery_images_height", true ) : 160;
  53.     $imageURL               = "";
  54.     $post_uniqueID              = 'post-'.get_the_ID().'';
  55.  
  56.     if($is_old_post && !$resize) $resize = true; //activate resizer for old posts
  57.    
  58.     //standart post types
  59.     if($post_format == "post"){
  60.         if($fist_featured_image && $resize) { // if resize is on
  61.             $image = @vt_resize('', $fist_featured_image, $width, $height, $crop );
  62.             $imageURL = $image["url"];
  63.         }else{
  64.             $imageURL = $fist_featured_image;
  65.         }    
  66.     }
  67.  
  68.  
  69.     //gallery post types
  70.     if($post_format == "gallery"){
  71.             $imageURL = $fist_featured_image;
  72.     }
  73.  
  74.     #
  75.     #   post formats
  76.     #  
  77.     //post format images
  78.     switch($post_format)
  79.     {
  80.         case 'gallery';     $post_format_image = "images.png";      break;
  81.         case 'aside';       $post_format_image = "post.png";        break;
  82.         case 'link';        $post_format_image = "link.png";        break;
  83.         case 'quote';       $post_format_image = "comment.png";     break;
  84.         case 'video';       $post_format_image = "video.png";       break;         
  85.         default;            $post_format_image = "post.png";        break;
  86.     }
  87.  
  88.     $post_format_image = THEMEURI.'/images/assets/icons/'.$post_format_image;
  89.     ?>
  90.        
  91.         <?php
  92.         #
  93.         #   link
  94.         #
  95.         if($post_format=="link"){
  96.             $link           = get_post_meta($post->ID, THEMESLUG.'post_format_link', true);
  97.             $link_html      = '<span class="post_url"><a href="'.$link.'" target="_new" title="'.get_the_title().'">'.$link.'</a></span>';
  98.         }else{$link_html=false;}
  99.         ?>
  100.  
  101.            
  102.  
  103.         <!-- blog box-->
  104.         <div id="post-<?php the_ID(); ?>" <?php post_class('box one blog loop blog_list box-shadow '.$post_class_img.''); ?>>
  105.            
  106.             <div class="blog-head-line <?php if($post_format=="link") echo "link";?> clearfix">
  107.    
  108.                 <?php if(!$hide_dates):?>
  109.                 <!-- post date -->
  110.                 <div class="date">
  111.                     <span class="day"><?php the_time("d") ?></span>
  112.                     <span class="year"><?php the_time("M") ?> <?php the_time("Y") ?></span>
  113.                 </div>
  114.  
  115.                 <div class="mobile-date"><?php the_time($date_format) ?></div>
  116.                 <!-- / end div .date -->
  117.                 <?php endif;?>
  118.                        
  119.                 <div class="post-title-holder">
  120.                     <!-- blog headline-->
  121.                     <h2>
  122.                         <?php if($post_format!="aside"):?>
  123.                             <a href="<?php echo get_permalink() ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a>
  124.                         <?php else:?>
  125.                             <?php the_title(); ?>
  126.                         <?php endif;?>
  127.                     </h2>
  128.                     <!-- / blog headline-->
  129.  
  130.                     <!-- post data -->
  131.                     <div class="post_data">
  132.                        
  133.                         <?php if($post_format=="link"):?>
  134.                             <?php echo $link_html;?>
  135.                         <?php else:?>
  136.                             <!-- post data -->
  137.                             <?php if($show_small_dates):?><span class="small_date"><?php the_time($date_format); ?></span><?php endif;?>
  138.                             <?php if(!$hide_author):?><span class="user margin-right20"><?php the_author_posts_link();?></span><?php endif;?>
  139.                             <?php if(!$hide_categories):?><span class="categories"><?php the_category(', ');?></span><?php endif;?>
  140.                             <?php if(!$hide_commnent_numbers  && $post_format!="aside"):?>
  141.                             <span class="comment_link"><a href="<?php comments_link(); ?>" title="" class="comment_link"><?php comments_number( __('0 Comment','rt_theme'), __('1 Comment','rt_theme'), __('% Comments','rt_theme') ); ?></a></span>
  142.                             <?php endif;?>
  143.                         <?php endif;?>
  144.  
  145.                     </div><!-- / end div  .post_data -->
  146.  
  147.                 </div><!-- / end div  .post-title-holder -->     
  148.             </div><!-- / end div  .blog-head-line -->  
  149.  
  150.  
  151.  
  152.             <?php
  153.             #
  154.             #   gallery
  155.             #
  156.             if($display_gallery_images == "same" && $post_format == "gallery"){
  157.                 //resize the photo
  158.                 $gallery_crop           = (get_post_meta($post->ID, THEMESLUG.'gallery_images_crop', true)) ? true : false;
  159.                 $gallery_images_height  = get_post_meta($post->ID, THEMESLUG.'gallery_images_height', true);
  160.                 $gallery_w              = $image_width;  
  161.                 $gallery_h              = ($gallery_crop) ? $gallery_images_height:10000;
  162.                 $gallery_list           = "";                                          
  163.  
  164.                
  165.                 //slider option
  166.                 if(is_array($rt_gallery_images) && $featured_image_usage=="slider"){
  167.  
  168.                         for ($i=0; $i < (count($rt_gallery_images)); $i++) {
  169.                                 $gallery_image_resized       = vt_resize("" , trim($rt_gallery_images[$i]) ,$gallery_w, $gallery_h, $gallery_crop);
  170.                                 $gallery_list               .= "<li>";
  171.                                 $gallery_list               .= '<a href="'.get_permalink().'"><img src="'.$gallery_image_resized['url'].'" alt="'.$rt_gallery_image_titles[$i].'" /></a>';
  172.                                
  173.                                 if($rt_gallery_image_titles[$i] || $rt_gallery_image_descs[$i]){
  174.                                     $gallery_list           .= '<div class="flex-caption"><div class="desc-background">';
  175.                                     if($rt_gallery_image_titles[$i])    $gallery_list           .= '<h5>'.$rt_gallery_image_titles[$i].'</h5>';
  176.                                     if($rt_gallery_image_descs[$i]) $gallery_list           .= '<p>'.$rt_gallery_image_descs[$i].'</p>';
  177.                                     $gallery_list           .= '</div></div></li>';                            
  178.                                 }
  179.                         }
  180.  
  181. echo <<<SCRIPT
  182.     <script type="text/javascript">
  183.      /* <![CDATA[ */
  184.         // Flex Slider and Helper Functions
  185.         jQuery(window).load(function() {
  186.             jQuery('#$post_uniqueID .slider-for-blog-posts').flexslider({
  187.                    animation: "fade",
  188.                    controlsContainer: "#$post_uniqueID .flex-nav-container",
  189.                    smoothHeight: true,
  190.                    directionNav: true,
  191.                    controlNav:false,
  192.                    prevText: "←",
  193.                    nextText: "→"
  194.             });
  195.         });  
  196.     /* ]]> */  
  197.     </script>
  198. SCRIPT;
  199.  
  200.                     echo '<div class="flex-container post_gallery"><div class="flexslider slider-for-blog-posts"><ul class="slides">'.$gallery_list.'</ul></div></div><div class="flex-nav-container"></div>';  
  201.                     echo '<div class="space margin-t20"></div>';
  202.                 }
  203.  
  204.                 //gallery option
  205.                 if(is_array($rt_gallery_images) && $featured_image_usage=="gallery"){  
  206.                         for ($i=0; $i < (count($rt_gallery_images)); $i++) {
  207.                                 $gallery_list       .= '[image thumb_width="'.$photo_gallery_images_width.'" thumb_height="'.$photo_gallery_images_height.'" lightbox="true" custom_link="" title="'.$rt_gallery_image_titles[$i].'" caption="'.$rt_gallery_image_descs[$i].'"]'.$rt_gallery_images[$i].'[/image]';
  208.                         }  
  209.                     $gallery_list  =  '[photo_gallery]'.$gallery_list.'[/photo_gallery]';
  210.                     echo apply_filters('the_content',($gallery_list));
  211.  
  212.                 }
  213.             }
  214.             ?>
  215.  
  216.             <?php
  217.             #
  218.             #   Standart post featured image
  219.             #  
  220.             if (    $fist_featured_image &&  ($post_format == "post"    || ($display_gallery_images == "only_featured_image"  && $post_format == "gallery"))):?>
  221.                 <!-- blog image-->
  222.                     <a href="<?php echo get_permalink() ?>" title="<?php echo $rt_gallery_image_titles[0]; ?>" class="imgeffect link align<?php echo $img_position;?>">
  223.                        <img src="<?php echo $imageURL;?>" class="featured_image" alt="<?php echo $rt_gallery_image_descs[0]; ?>" />
  224.                     </a>  
  225.                 <!-- / blog image -->
  226.                
  227.                 <?php if($img_position=="center"):?>
  228.                     <div class="space margin-t20"></div>
  229.                 <?php endif;?>
  230.             <?php endif;?>       
  231.  
  232.  
  233.             <?php
  234.             #
  235.             #   audio format
  236.             #
  237.             if($post_format=="audio"){
  238.                 $post_audio_mp3 =   get_post_meta($post->ID, THEMESLUG.'_post_audio_mp3', true);
  239.                 $post_audio_oga =   get_post_meta($post->ID, THEMESLUG.'_post_audio_oga', true);
  240.  
  241.                 //poster image
  242.                 $poster_image = "";
  243.                 if($fist_featured_image && $resize) { // if resize is on
  244.                     $image = @vt_resize('', $fist_featured_image, $width, $height, $crop );
  245.                     $poster_image = $image["url"];
  246.                 }else{
  247.                     $poster_image = $fist_featured_image;
  248.                 }
  249.             ?>
  250.                 <script type="text/javascript">
  251.                 //<![CDATA[
  252.        
  253.                     jQuery(document).ready(function($){
  254.            
  255.                         if($().jPlayer) {
  256.                             $("#<?php echo $post->ID;?>_audio").jPlayer({
  257.                                 ready: function () {
  258.                                     $(this).jPlayer("setMedia", {
  259.                                         <?php echo $poster_image ? 'poster:"'.$poster_image.'",' : "";?>
  260.                                         <?php echo $post_audio_mp3 ? 'mp3:"'.$post_audio_mp3.'",' : "";?>
  261.                                         <?php echo $post_audio_oga ? 'oga:"'.$post_audio_oga.'",' : "";?>
  262.                                         end: ""
  263.                                     });
  264.                                        
  265.                                     <?php if($poster_image):?>
  266.                                     $(this).parents(".jp-holder").find(".remove_image").remove();
  267.                                     $(this).css({"position":"static"});
  268.                                     <?php endif;?>
  269.                                 },
  270.                                 size: {
  271.                                     width: "100%",
  272.                                     <?php if($poster_image):?>height: "auto"<?php else:?>height: "40px"<?php endif;?>
  273.                                 },
  274.                                 swfPath: "<?php echo THEMEURI;?>/js/",
  275.                                 cssSelectorAncestor: "#<?php echo $post->ID;?>_audio_interface",
  276.                                 supplied: "<?php if($post_audio_mp3){echo "mp3,";}?> <?php if($post_audio_oga){echo "oga,";}?>, all"
  277.                             });
  278.                                
  279.                  
  280.                         }
  281.                     });
  282.                 //]]>
  283.                 </script>
  284.                 <div class="jp-holder">
  285.                 <?php if($poster_image):?><img src="<?php echo $poster_image;?>" alt="" class="remove_image" style="opacity:0;width:100%;height:auto;"/><?php endif;?>
  286.                 <div class="jp-container">         
  287.                     <div id="<?php echo $post->ID;?>_audio" class="jp-jplayer jp-jplayer-audio" <?php if($poster_image):?>style="position:absolute;"<?php endif;?>></div>
  288.                    
  289.                     <!-- controllers -->
  290.                     <div class="jp-audio-container <?php if(!$poster_image):?>noposter<?php endif;?>">
  291.                         <div class="jp-audio">
  292.                             <div class="jp-type-single">
  293.                                <div id="<?php echo $post->ID;?>_audio_interface" class="jp-interface">
  294.                                     <div class="jp-controls">  
  295.                                         <a href="#" class="jp-play" tabindex="1">play</a>
  296.                                         <a href="#" class="jp-pause" tabindex="1">pause</a>
  297.                                     </div>
  298.                                    
  299.                                     <div class="jp-progress-container">
  300.                                         <div class="jp-progress">
  301.                                             <div class="jp-seek-bar">
  302.                                                 <div class="jp-play-bar"></div>
  303.                                             </div>
  304.                                         </div>
  305.                                     </div>
  306.                                    
  307.                                     <div class="jp-volume-bar-container">
  308.                                         <div class="jp-valume-controllers">
  309.                                             <a href="#" class="jp-mute" tabindex="1">mute</a>
  310.                                             <a href="#" class="jp-unmute" tabindex="1">unmute</a>
  311.                                         </div>
  312.                                         <div class="jp-volume-bar">
  313.                                             <div class="jp-volume-bar-value"></div>
  314.                                         </div>
  315.                                     </div>
  316.        
  317.                                     <div class="jp-current-time">00:00</div>
  318.        
  319.                                </div>
  320.                             </div>
  321.                         </div>
  322.                     </div><!-- / controllers end -->
  323.                 </div>
  324.             </div>
  325.             <?php  
  326.             }
  327.             ?>
  328.  
  329.  
  330.             <?php
  331.             #
  332.             #   video format
  333.             #
  334.             if($post_format=="video"){
  335.             $video_url = get_post_meta($post->ID, THEMESLUG.'video_url', true);
  336.             if ($video_url){
  337.                  
  338.                 if( strpos($video_url, 'youtube')  ) { //youtube
  339.                     echo '<iframe  width="100%" height="'.$video_height.'" src="http://www.youtube.com/embed/'.find_tube_video_id($video_url).'" frameborder="0" allowfullscreen></iframe>';
  340.                 }
  341.                
  342.                 if( strpos($video_url, 'vimeo')  ) { //vimeo
  343.                     echo '<iframe  src="http://player.vimeo.com/video/'.find_tube_video_id($video_url).'?color=d6d6d6&title=0&amp;byline=0&amp;portrait=0" width="100%" height="'.$video_height.'" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>';
  344.                 }
  345.                
  346.                 echo '<div class="space margin-t20"></div>';
  347.             }else{
  348.  
  349.                 $post_video_m4v =   get_post_meta($post->ID, THEMESLUG.'_post_video_m4v', true);
  350.                 $post_video_ogv =   get_post_meta($post->ID, THEMESLUG.'_post_video_ogv', true);
  351.  
  352.                 //poster image
  353.                 $poster_image = "";
  354.                 if($fist_featured_image && $resize) { // if resize is on
  355.                     $image = @vt_resize('', $fist_featured_image, $width, $height, $crop );
  356.                     $poster_image = $image["url"];
  357.                 }else{
  358.                     $poster_image = $fist_featured_image;
  359.                 }
  360.             ?>  
  361.                 <script type="text/javascript">
  362.                 //<![CDATA[
  363.                     jQuery(document).ready(function($){
  364.                         if($().jPlayer) {
  365.                             $("#jquery_jplayer_<?php echo $post->ID;?>").jPlayer({
  366.                                 ready: function () {
  367.                                     $(this).jPlayer("setMedia", {
  368.                                         <?php echo isset($image) ? 'poster:"'.$poster_image.'",' : "";?>
  369.                                         <?php echo $post_video_m4v ? 'm4v:"'.$post_video_m4v.'",' : "";?>
  370.                                         <?php echo $post_video_ogv ? 'ogv:"'.$post_video_ogv.'",' : "";?>
  371.                                         end: ""
  372.                                     });
  373.                                     <?php if($poster_image):?>
  374.                                     $(this).parents(".jp-holder").find(".remove_image").remove();
  375.                                     $(this).css({"position":"static"});
  376.                                     <?php endif;?>
  377.        
  378.                                 },
  379.                                 <?php $ua = browser_info();//user browser
  380.                                     if (    (isset($ua['msie']) && $ua['msie']!="" && version_compare($ua['msie'],"9","<")) || ($post_video_m4v && !$post_video_ogv)): // IE8 & before
  381.                                 ?>                     
  382.                                     size: {
  383.                                         width: "<?php echo $video_width;?>px",
  384.                                         height: "<?php echo $video_height;?>px",
  385.                                         end: ""
  386.                                     },
  387.                                 <?php else:?>
  388.                                     size: {
  389.                                         width: "100%",
  390.                                         height: "auto"
  391.                                     },
  392.                                 <?php endif;?>
  393.        
  394.                                 swfPath: "<?php echo THEMEURI;?>/js/",
  395.                                 cssSelectorAncestor: "#jp_interface_<?php echo $post->ID;?>",
  396.                                 supplied: "<?php if($post_video_m4v){echo "m4v,";}?> <?php if($post_video_ogv){echo "ogv,";}?>, all"
  397.                             });      
  398.                         }
  399.                     });  
  400.                 //]]>
  401.                 </script>
  402.        
  403.                 <div class="jp-holder">
  404.                  
  405.                 <?php if($poster_image):?><img src="<?php echo $poster_image;?>" alt="" class="remove_image" style="opacity:0;width:100%;height:auto;"/><?php endif;?>
  406.        
  407.                     <div id="jp_interface_<?php echo $post->ID;?>" class="jp-video jp-container">
  408.                         <div class="jp-type-single">
  409.                             <div id="jquery_jplayer_<?php echo $post->ID;?>" class="jp-jplayer jp-jplayer-video" <?php if($poster_image):?>style="position:absolute;"<?php else:?>style="min-height:40px;"<?php endif;?>></div>
  410.          
  411.                             <!-- controllers -->
  412.                             <div class="jp-gui <?php if(!$poster_image):?>noposter<?php endif;?>">                 
  413.                                 <div class="jp-interface">
  414.                                       <div class="jp-controls">  
  415.                                           <a href="javascript:;" class="jp-play" tabindex="1">play</a>
  416.                                           <a href="javascript:;" class="jp-pause" tabindex="1">pause</a>
  417.                                       </div>
  418.                                      
  419.                                       <div class="jp-progress-container">
  420.                                           <div class="jp-progress">
  421.                                               <div class="jp-seek-bar">
  422.                                                   <div class="jp-play-bar"></div>
  423.                                               </div>
  424.                                           </div>
  425.                                       </div>
  426.                                      
  427.                                       <div class="jp-current-time">00:00</div>
  428.          
  429.                                       <div class="jp-volume-bar-container">
  430.                                           <div class="jp-valume-controllers">
  431.                                               <a href="javascript:;" class="jp-mute" tabindex="1">mute</a>
  432.                                               <a href="javascript:;" class="jp-unmute" tabindex="1">unmute</a>
  433.                                           </div>
  434.                                           <div class="jp-volume-bar">
  435.                                               <div class="jp-volume-bar-value"></div>
  436.                                           </div>
  437.                                       </div>
  438.          
  439.                                       <div class="jp-toggles">
  440.                                           <a href="javascript:;" class="jp-full-screen" tabindex="1" title="full screen">full screen</a>
  441.                                           <a href="javascript:;" class="jp-restore-screen" tabindex="1" title="restore screen">restore screen</a>
  442.                                       </div>       
  443.                                 </div>   
  444.                             </div><!-- / controllers end -->
  445.                         </div>
  446.                     </div>
  447.                 </div>
  448.                 <div class="space margin-b20"></div>
  449.             <?php  
  450.             }}         
  451.             ?>
  452.  
  453.             <?php if(get_the_excerpt()):?>
  454.  
  455.                 <?php if($post_format=="link"):?><div class="space margin-b20"></div><?php endif;?>
  456.             <!-- blog text-->
  457.                 <?php
  458.                 if(!empty($post->post_content) && $post_format!="aside"): $link=' <a href="'. get_permalink($post->ID) . ' " class="read_more" >'.__('read more →','rt_theme').'</a>';else:$link="";endif;               
  459.                
  460.                 echo apply_filters('the_content',(get_the_content().$link));   
  461.  
  462.                 ?>
  463.             <!-- /blog text-->
  464.             <?php endif;?>     
  465.  
  466.  
  467.             <?php if($img_position!="center"):?><div class="space margin-t10"></div><?php endif;?>
  468.  
  469.             </div> <!-- / blog box-->    
  470.            
  471.             <?php
  472.             //add space until last item
  473.             if(intval($post_count)-1 != $postCount++) echo '<div class="space margin-b30"></div>';
  474.             ?>
  475.            
  476.    
  477. <?php endwhile; ?>
  478.  
  479.        
  480. <?php
  481. //get page and post counts
  482. $page_count=get_page_count();
  483. ?>
  484.  
  485. <?php if($page_count['page_count']>1 && $paged):?>
  486.     <div class="space margin-b30"></div>
  487.     <!-- paging-->
  488.     <div class="paging_wrapper clearfix">
  489.         <ul class="paging">
  490.             <?php get_pagination(); ?>
  491.         </ul>
  492.     </div>         
  493. <?php endif;?>
  494.  
  495. <?php wp_reset_query();?>
  496.  
  497. <?php else: ?>
  498.         <p><?php _e( 'Sorry, no posts matched your criteria.', 'rt_theme'); ?></p>
  499. <?php endif; ?>