Guest User

sdfdsf

a guest
Oct 27th, 2017
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 6.11 KB | None | 0 0
  1. <?php
  2. global $avia_config;
  3.  
  4.  
  5. // check if we got posts to display:
  6. if (have_posts()) :
  7.     $first = true;
  8.  
  9.     $counterclass = "";
  10.     $post_loop_count = 1;
  11.     $page = (get_query_var('paged')) ? get_query_var('paged') : 1;
  12.     if($page > 1) $post_loop_count = ((int) ($page - 1) * (int) get_query_var('posts_per_page')) +1;
  13.     $blog_style = avia_get_option('blog_style','multi-big');
  14.  
  15.     while ( have_posts() ) : the_post();
  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.  
  26.     <article <?php post_class('post-entry post-entry-type-'.$post_format . " " . $post_class . " "); avia_markup_helper(array('context' => 'entry')); ?>>
  27.         <div class="entry-content-wrapper clearfix <?php echo $post_format; ?>-content">
  28.  
  29.             <header class="entry-content-header">
  30.                 <?php
  31.                 echo "<span class='search-result-counter {$counterclass}'>{$post_loop_count}</span>";
  32.                 //echo the post title
  33.                 $markup = avia_markup_helper(array('context' => 'entry_title','echo'=>false));
  34.                 echo "<h2 class='post-title entry-title'><a title='".the_title_attribute('echo=0')."' href='".get_permalink()."' $markup>".get_the_title()."</a></h2>";
  35.  
  36.                 ?>
  37.                 <span class='post-meta-infos'>
  38.                     <time class='date-container minor-meta updated' <?php avia_markup_helper(array('context' => 'entry_time')); ?>>
  39.                         <?php the_time('d M Y'); ?>
  40.                     </time>
  41.                     <?php
  42.  
  43.                     $taxonomies  = get_object_taxonomies(get_post_type($the_id));
  44.                     $cats = '';
  45.                     $excluded_taxonomies = array_merge( get_taxonomies( array( 'public' => false ) ), array('post_tag','post_format') );
  46.                     $excluded_taxonomies = apply_filters('avf_exclude_taxonomies', $excluded_taxonomies, get_post_type($the_id), $the_id);
  47.  
  48.                     if(!empty($taxonomies))
  49.                     {
  50.                         foreach($taxonomies as $taxonomy)
  51.                         {
  52.                             if(!in_array($taxonomy, $excluded_taxonomies))
  53.                             {
  54.                                 $cats .= get_the_term_list($the_id, $taxonomy, '', ', ','').' ';
  55.                             }
  56.                         }
  57.                     }
  58.  
  59.                     if(!empty($cats))
  60.                     {
  61.                         echo "<span class='text-sep'>/</span>";
  62.                         echo '<span class="blog-categories minor-meta">'.__('in','avia_framework')." ";
  63.                         echo $cats;
  64.                         echo '</span>';
  65.                     }
  66.  
  67.                                         $author_name = apply_filters('avf_author_name', get_the_author_meta('display_name', $post->post_author), $post->post_author);
  68.                                         $author_email = apply_filters('avf_author_email', get_the_author_meta('email', $post->post_author), $post->post_author);
  69.  
  70.                                         $gravatar_alt = esc_html($author_name);
  71.                                         $gravatar = get_avatar($author_email, '81', "blank", $gravatar_alt);
  72.                                         $link = get_author_posts_url($post->post_author);
  73.  
  74.                                         echo "<span class='text-sep'>/</span>";
  75.                                         echo "<a href='{$link}' class='post-author-format-type'>".$author_name."</a>";
  76.  
  77.                     ?>
  78.  
  79.                 </span>
  80.             </header>
  81.  
  82.             <?php
  83.                 echo '<div class="entry-content" '.avia_markup_helper(array('context' => 'entry_content','echo'=>false)).'>';
  84.                 $excerpt = trim(get_the_excerpt());
  85.                 if(!empty($excerpt))
  86.                 {
  87.                     the_excerpt();
  88.                 }
  89.                 else
  90.                 {
  91.                     $excerpt = strip_shortcodes( get_the_content() );
  92.                     $excerpt = apply_filters('the_excerpt', $excerpt);
  93.                     $excerpt = str_replace(']]>', ']]&gt;', $excerpt);
  94.                     echo $excerpt;
  95.                 }
  96.                 echo '</div>';
  97.             ?>
  98.         </div>
  99.  
  100.         <footer class="entry-footer"></footer>
  101.  
  102.         <?php do_action('ava_after_content', $the_id, 'loop-search'); ?>
  103.     </article><!--end post-entry-->
  104.  
  105.     <?php
  106.  
  107.  
  108.         $first = false;
  109.         $post_loop_count++;
  110.         if($post_loop_count >= 100) $counterclass = "nowidth";
  111.     endwhile;
  112.     else:
  113.  
  114.  
  115. ?>
  116.  
  117.     <article class="entry entry-content-wrapper clearfix" id='search-fail'>
  118.             <p class="entry-content" <?php avia_markup_helper(array('context' => 'entry_content')); ?>>
  119.                 <strong><?php _e('Nothing Found', 'avia_framework'); ?></strong><br/>
  120.                <?php _e('Sorry, no posts matched your criteria. Please try another search', 'avia_framework'); ?>
  121.             </p>
  122.  
  123.             <div class='hr_invisible'></div>
  124.  
  125.             <section class="search_not_found">
  126.                 <p><?php _e('You might want to consider some of our suggestions to get better results:', 'avia_framework'); ?></p>
  127.                 <ul>
  128.                     <li><?php _e('Check your spelling.', 'avia_framework'); ?></li>
  129.                     <li><?php _e('Try a similar keyword, for example: tablet instead of laptop.', 'avia_framework'); ?></li>
  130.                     <li><?php _e('Try using more than one keyword.', 'avia_framework'); ?></li>
  131.                 </ul>
  132.  
  133.                 <div class='hr_invisible'></div>
  134.                 <h3 class=''><?php _e('Feel like browsing some posts instead?', 'avia_framework'); ?></h3>
  135.  
  136.         <?php
  137.         the_widget('avia_combo_widget', 'error404widget', array('widget_id'=>'arbitrary-instance-'.$id,
  138.                 'before_widget' => '<div class="widget avia_combo_widget">',
  139.                 'after_widget' => '</div>',
  140.                 'before_title' => '<h3 class="widgettitle">',
  141.                 'after_title' => '</h3>'
  142.             ));
  143.         echo '</section>';
  144.     echo "</article>";
  145.  
  146.     endif;
  147.     echo avia_pagination('', 'nav');
  148. ?>
Advertisement
Add Comment
Please, Sign In to add comment