Advertisement
Guest User

Untitled

a guest
Jan 3rd, 2018
46
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.71 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. if(get_post_type() !== "page")
  43. {
  44. if ( get_comments_number() != "0" || comments_open() )
  45. {
  46. echo "<span class='text-sep'>/</span>";
  47. echo "<span class='comment-container minor-meta'>";
  48. comments_popup_link( "0 ".__('Comments','avia_framework'),
  49. "1 ".__('Comment' ,'avia_framework'),
  50. "% ".__('Comments','avia_framework'),'comments-link',
  51. "".__('Comments Disabled','avia_framework'));
  52. echo "</span>";
  53. }
  54. }
  55.  
  56.  
  57. $taxonomies = get_object_taxonomies(get_post_type($the_id));
  58. $cats = '';
  59. $excluded_taxonomies = array_merge( get_taxonomies( array( 'public' => false ) ), array('post_tag','post_format') );
  60. $excluded_taxonomies = apply_filters('avf_exclude_taxonomies', $excluded_taxonomies, get_post_type($the_id), $the_id);
  61.  
  62. if(!empty($taxonomies))
  63. {
  64. foreach($taxonomies as $taxonomy)
  65. {
  66. if(!in_array($taxonomy, $excluded_taxonomies))
  67. {
  68. $cats .= get_the_term_list($the_id, $taxonomy, '', ', ','').' ';
  69. }
  70. }
  71. }
  72.  
  73. if(!empty($cats))
  74. {
  75. echo "<span class='text-sep'>/</span>";
  76. echo '<span class="blog-categories minor-meta">'.__('in','avia_framework')." ";
  77. echo $cats;
  78. echo '</span>';
  79. }
  80.  
  81. ?>
  82.  
  83. </span>
  84. </header>
  85.  
  86. <?php
  87. echo '<div class="entry-content" '.avia_markup_helper(array('context' => 'entry_content','echo'=>false)).'>';
  88. $excerpt = trim(get_the_excerpt());
  89. if(!empty($excerpt))
  90. {
  91. the_excerpt();
  92. }
  93. else
  94. {
  95. $excerpt = strip_shortcodes( get_the_content() );
  96. $excerpt = apply_filters('the_excerpt', $excerpt);
  97. $excerpt = str_replace(']]>', ']]&gt;', $excerpt);
  98. echo $excerpt;
  99. }
  100. echo '</div>';
  101. ?>
  102. </div>
  103.  
  104. <footer class="entry-footer"></footer>
  105.  
  106. <?php do_action('ava_after_content', $the_id, 'loop-search'); ?>
  107. </article><!--end post-entry-->
  108.  
  109. <?php
  110.  
  111.  
  112. $first = false;
  113. $post_loop_count++;
  114. if($post_loop_count >= 100) $counterclass = "nowidth";
  115. endwhile;
  116. else:
  117.  
  118.  
  119. ?>
  120.  
  121. <article class="entry entry-content-wrapper clearfix" id='search-fail'>
  122. <p class="entry-content" <?php avia_markup_helper(array('context' => 'entry_content')); ?>>
  123. <strong><?php _e('Nothing Found', 'avia_framework'); ?></strong><br/>
  124. <?php _e('Sorry, no posts matched your criteria. Please try another search', 'avia_framework'); ?>
  125. </p>
  126.  
  127. <div class='hr_invisible'></div>
  128.  
  129. <section class="search_not_found">
  130. <p><?php _e('You might want to consider some of our suggestions to get better results:', 'avia_framework'); ?></p>
  131. <ul>
  132. <li><?php _e('Check your spelling.', 'avia_framework'); ?></li>
  133. <li><?php _e('Try a similar keyword, for example: tablet instead of laptop.', 'avia_framework'); ?></li>
  134. <li><?php _e('Try using more than one keyword.', 'avia_framework'); ?></li>
  135. </ul>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement