1. <?php
  2. global $avia_config, $post_loop_count;
  3.  
  4.  
  5. if(empty($post_loop_count)) $post_loop_count = 1;
  6. $blog_style = !empty($avia_config['blog_style']) ? $avia_config['blog_style'] : avia_get_option('blog_style','multi-big');
  7. $blog_content = !empty($avia_config['blog_content']) ? $avia_config['blog_content'] : "content";
  8.  
  9. // check if we got posts to display:
  10. if (have_posts()) :
  11.  
  12.     while (have_posts()) : the_post();
  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.     $last           = count($wp_query->posts) == $post_loop_count ? " post-entry-last " : "";
  21.     $post_class     = "post-entry-".$the_id." post-loop-".$post_loop_count." post-parity-".$parity.$last." ".$blog_style;
  22.     $post_format    = get_post_format() ? get_post_format() : 'standard';
  23.  
  24.     /*
  25.      * retrieve slider, title and content for this post,...
  26.      */
  27.     $size = strpos($blog_style, 'big') ? strpos(avia_layout_class( 'main' , false), 'sidebar') ? 'entry_with_sidebar' : 'entry_without_sidebar' : 'square';
  28.     if(!empty($avia_config['preview_mode']) && !empty($avia_config['image_size']) && $avia_config['preview_mode'] == 'custom') $size = $avia_config['image_size'];
  29.     $current_post['slider']     = get_the_post_thumbnail($the_id, $size);
  30.     $current_post['title']      = get_the_title();
  31.     $current_post['content']    = $blog_content == "content" ? get_the_content(__('Read more','avia_framework').'<span class="more-link-arrow">  &rarr;</span>') : get_the_excerpt();
  32.     $current_post['content']    = $blog_content == "excerpt_read_more" ? $current_post['content'].'<div class="read-more-link"><a href="'.get_permalink().'" class="more-link">'.__('Read more','avia_framework').'<span class="more-link-arrow">  &rarr;</span></a></div>' : $current_post['content'];
  33.     $current_post['before_content'] = "";
  34.  
  35.     /*
  36.      * ...now apply a filter, based on the post type... (filter function is located in includes/helper-post-format.php)
  37.      */
  38.     $current_post   = apply_filters( 'post-format-'.$post_format, $current_post );
  39.     $with_slider    = empty($current_post['slider']) ? "" : "with-slider";
  40.     /*
  41.      * ... last apply the default wordpress filters to the content
  42.      */
  43.     $current_post['content'] = str_replace(']]>', ']]&gt;', apply_filters('the_content', $current_post['content'] ));
  44.  
  45.     /*
  46.      * Now extract the variables so that $current_post['slider'] becomes $slider, $current_post['title'] becomes $title, etc
  47.      */
  48.     extract($current_post);
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.     /*
  58.      * render the html:
  59.      */
  60.  
  61.     echo "<div class='".implode(" ", get_post_class('post-entry post-entry-type-'.$post_format . " " . $post_class . " ".$with_slider))."'>";
  62.             echo "<div class='modified-blog'>";
  63.             echo $title;
  64.  
  65.                 echo "<span class='post-meta-infos'>";
  66.                 echo "<span class='date-container minor-meta'>".get_the_time('d M Y')."</span>";
  67.                 echo "<span class='text-sep'>/</span>";
  68.  
  69.  
  70.  
  71.                     if ( get_comments_number() != "0" || comments_open() ){
  72.  
  73.                     echo "<span class='comment-container minor-meta'>";
  74.                     comments_popup_link(  "0 ".__('Comments','avia_framework'),
  75.                                           "1 ".__('Comment' ,'avia_framework'),
  76.                                           "% ".__('Comments','avia_framework'),'comments-link',
  77.                                           "".__('Comments Disabled','avia_framework'));
  78.                     echo "</span>";
  79.                     echo "<span class='text-sep'>/</span>";
  80.                     }
  81.  
  82.  
  83.                     $taxonomies  = get_object_taxonomies(get_post_type($the_id));
  84.                     $cats = '';
  85.                     $excluded_taxonomies =  apply_filters('avf_exclude_taxonomies', array('post_tag','post_format'), get_post_type($the_id), $the_id);
  86.  
  87.                     if(!empty($taxonomies))
  88.                     {
  89.                         foreach($taxonomies as $taxonomy)
  90.                         {
  91.                             if(!in_array($taxonomy, $excluded_taxonomies))
  92.                             {
  93.                                 $cats .= get_the_term_list($the_id, $taxonomy, '', ', ','').' ';
  94.                             }
  95.                         }
  96.                     }
  97.  
  98.                     if(!empty($cats))
  99.                     {
  100.                         echo '<span class="blog-categories minor-meta">'.__('in','avia_framework')." ";
  101.                         echo $cats;
  102.                         echo '</span><span class="text-sep">/</span>';
  103.                     }
  104.  
  105.  
  106.                     echo '<span class="blog-author minor-meta">'.__('by','avia_framework')." ";
  107.                     the_author_posts_link();
  108.                     echo '</span>';
  109.                 echo '</span>';
  110.             echo "</div>";
  111.  
  112.             //default link for preview images
  113.             $link = get_permalink();
  114.  
  115.             //on single page replace the link with a fullscreen image
  116.             if(is_singular())
  117.             {
  118.                 $link = avia_image_by_id(get_post_thumbnail_id(), 'large', 'url');
  119.             }
  120.  
  121.  
  122.             //echo preview image
  123.             if(strpos($blog_style, 'big') !== false)
  124.             {
  125.                 if($slider) $slider = '<a href="'.$link.'">'.$slider.'</a>';
  126.                 if($slider) echo '<div class="big-preview '.$blog_style.'">'.$slider.'</div>';
  127.             }
  128.  
  129.             if(!empty($before_content))
  130.                 echo '<div class="big-preview '.$blog_style.'">'.$before_content.'</div>';
  131.  
  132.             echo "<div class='blog-meta'>";
  133.  
  134.             $icon =  '<span class="iconfont">'.$avia_config['font_icons'][$post_format]."</span>";
  135.  
  136.                 if(strpos($blog_style, 'multi') !== false)
  137.                 {
  138.                     $gravatar = "";
  139.                     $link = get_post_format_link($post_format);
  140.                     if($post_format == 'standard')
  141.                     {
  142.                         $gravatar = get_avatar( get_the_author_meta('email'), '75', "blank" );
  143.                         $link = get_author_posts_url($post->post_author);
  144.                     }
  145.  
  146.                     echo "<a href='{$link}' class='post-author-format-type'><span class='rounded-container'>".$gravatar.$icon."</span></a>";
  147.                 }
  148.                 else if(strpos($blog_style, 'small')  !== false)
  149.                 {
  150.  
  151.                     echo "<a href='{$link}' class='small-preview'>".$slider.$icon."</a>";
  152.                 }
  153.  
  154.             echo "</div>";
  155.            
  156.             echo "<div class='entry-content clearfix {$post_format}-content'>";
  157.            
  158.             // echo the post content
  159.                 echo $content;
  160.  
  161.                 wp_link_pages(array('before' =>'<div class="pagination_split_post">',
  162.                                         'after'  =>'</div>',
  163.                                         'pagelink' => '<span>%</span>'
  164.                                         ));
  165.  
  166.                 if(has_tag() && is_single())
  167.                 {
  168.                     echo '<span class="blog-tags minor-meta">';
  169.                     the_tags('<strong>'.__('Tags:','avia_framework').'</strong><span> ');
  170.                     echo '</span></span>';
  171.                 }
  172.            
  173.             echo "<div class='post_delimiter'></div>";
  174.             echo "</div>";
  175.             echo "<div class='post_author_timeline'></div>";
  176.             echo "</div>";
  177.  
  178.     $post_loop_count++;
  179.     endwhile;
  180.     else:
  181.  
  182. ?>
  183.  
  184. <div class="entry">
  185. <h2 class='post-title'><?php _e('Nothing Found', 'avia_framework'); ?></h2>
  186. <p><?php _e('Sorry, no posts matched your criteria', 'avia_framework'); ?></p>
  187. </div>
  188.  
  189. <?php
  190.  
  191.     endif;
  192.  
  193.     if(empty($avia_config['remove_pagination'] ))
  194.     {
  195.         echo "<div class='{$blog_style}'>".avia_pagination()."</div>";
  196.     }
  197. ?>