Advertisement
Guest User

loop-index.php

a guest
Aug 19th, 2014
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 4.73 KB | None | 0 0
  1. <?php
  2. global $avia_config, $post_loop_count;
  3.  
  4. do_action( 'avia_action_query_check' , 'loop-index' );
  5.  
  6. if(empty($post_loop_count)) $post_loop_count = 1;
  7.  
  8. // check if we got posts to display:
  9. if (have_posts()) :
  10.  
  11.     while (have_posts()) : the_post(); 
  12.    
  13.    
  14.     /*
  15.      * get the current post id, the current post class and current post format
  16.      */
  17.      
  18.     $the_id         = get_the_ID();
  19.     $parity         = $post_loop_count % 2 ? 'odd' : 'even';
  20.     $post_class     = "post-entry-".$the_id." post-loop-".$post_loop_count." post-parity-".$parity;
  21.     $post_format    = get_post_format() ? get_post_format() : 'standard';
  22.     $subtitle       = avia_post_meta($the_id, 'subtitle');
  23.     $sliderHtml     = false;
  24.    
  25.     /*
  26.      * retrieve slider, title and content for this post,...
  27.      */
  28.    
  29.     $current_post['slider']     = new avia_slideshow($the_id);
  30.     $current_post['title']      = get_the_title();
  31.     $current_post['content']    = get_the_content(__('Read more','avia_framework').'<span class="more-link-arrow">  &rarr;</span>');
  32.     $current_post['subtitle']   = $subtitle ? "<div class='subtitle_intro'>".apply_filters('the_content',$subtitle)."</div>" : "";
  33.    
  34.     /*
  35.      * ...now apply a filter, based on the post type... (filter function is located in includes/helper-post-format.php)
  36.      */
  37.     $current_post   = apply_filters( 'post-format-'.$post_format, $current_post );
  38.    
  39.     /*
  40.      * ... last apply the default wordpress filters to the content
  41.      */
  42.     $current_post['content'] = str_replace(']]>', ']]&gt;', apply_filters('the_content', $current_post['content'] ));
  43.    
  44.     /*
  45.      * Now extract the variables so that $current_post['slider'] becomes $slider, $current_post['title'] becomes $title, etc
  46.      */
  47.     extract($current_post);
  48.    
  49.     /*
  50.      * save slider html output
  51.      */
  52.     if($slider && $slider->slidecount)
  53.     {
  54.         $sliderHtml = $slider->display();
  55.         $post_class .= " with-slideshow";
  56.     }
  57.     /*
  58.      * render the html:
  59.      */
  60.     ?>
  61.    
  62.         <div class='post-entry post-entry-type-<?php echo $post_format." ".$post_class; ?>'>
  63.                    
  64.             <?php
  65.            
  66.             //echo slideshow
  67.             echo $sliderHtml;
  68.                        
  69.             ?>
  70.             <span class='date-container date-container-mobile minor-meta meta-color'><?php echo get_the_date(); ?></span>
  71.             <!--meta info-->       
  72.  
  73.             <div class="eight units entry-content <?php echo $post_format; ?>-content">
  74.                
  75.                 <?php
  76.                
  77.                 //echo the post title
  78.                 echo $title;
  79.                
  80.                 // subtitle
  81.                 echo $subtitle;
  82.                
  83.                 // echo the post content
  84.                 echo $content;
  85.                
  86.                 if(has_tag() && is_single())
  87.                 {  
  88.                     echo '<span class="blog-tags minor-meta">';
  89.                     echo the_tags('<strong>'.__('Tags: ','avia_framework').'</strong><span>');
  90.                     echo '</span></span>';
  91.                 }
  92.                 ?>
  93.                
  94.                
  95.                
  96.                 <div class='blog-inner-meta extralight-border'>
  97.                
  98.                     <div class='post-meta-infos'>
  99.                                                
  100.                         <?php
  101.                        
  102.                         if(comments_open() || get_comments_number())
  103.                         {
  104.                             echo "<span class='comment-container minor-meta'>";
  105.                             comments_popup_link(" <span>0 ".__('Comments','avia_framework')."</span>",
  106.                                                 " <span>1 ".__('Comment' ,'avia_framework')."</span>",
  107.                                                 " <span>% ".__('Comments','avia_framework')."</span>",'comments-link',
  108.                                                 __('Comments Off'  ,'avia_framework'));    
  109.                             echo "</span><span class='text-sep comment-container-sep'>/</span>";     
  110.                         }
  111.                                                
  112.                         $cats = get_the_category();
  113.                         if(!empty($cats))
  114.                         {
  115.                             // __('posted in','avia_framework')
  116.                             echo '<span class="blog-categories minor-meta">'.__('in','avia_framework')." ";
  117.                             the_category(', ');
  118.                             echo ' </span>';
  119.                              echo '<span class="text-sep cat-sep">/</span>';
  120.                         }
  121.                        
  122.                        
  123.                         echo '<span class="blog-author minor-meta">'.__('by ','avia_framework');
  124.                         the_author_posts_link();
  125.                         echo '</span><span class="text-sep author-sep">/</span>';
  126.                        
  127.                         echo '<span class="blog-permalink minor-meta">';
  128.                         echo "<a href='".get_permalink()."'>".__('#permalink','avia_framework')."</a>";
  129.                         echo '</span><span class="text-sep author-sep">/</span>';
  130.                        
  131.                         echo '<span class="time minor-meta">';
  132.                         echo get_the_date('', $post->ID);
  133.                         echo '</span>';
  134.                        
  135.                        
  136.                         ?>
  137.                    
  138.                     </div> 
  139.                    
  140.                 </div>
  141.  
  142.                                
  143.             </div> 
  144.            
  145.  
  146.         </div><!--end post-entry-->
  147.     <?php
  148.    
  149.     $post_loop_count++;    
  150.     endwhile;      
  151.     else:
  152.    
  153. ?> 
  154.    
  155.     <div class="entry">
  156.         <h1 class='post-title'><?php _e('Nothing Found', 'avia_framework'); ?></h1>
  157.         <p><?php _e('Sorry, no posts matched your criteria', 'avia_framework'); ?></p>
  158.     </div>
  159.    
  160. <?php
  161.  
  162.     endif;
  163.    
  164.     if(!isset($avia_config['remove_pagination'] ))
  165.     {
  166.         echo "<div class='".avia_layout_class('entry', false)." ".avia_offset_class('meta', false)." units'>";
  167.         echo avia_pagination();
  168.         echo "</div>";
  169.     }
  170. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement