Guest User

Search and Filter Pro template

a guest
Oct 15th, 2015
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.92 KB | None | 0 0
  1. <?php
  2. /**
  3. * Search & Filter Pro
  4. *
  5. * Sample Results Template
  6. *
  7. * @package Search_Filter
  8. * @author Ross Morsali
  9. * @link http://www.designsandcode.com/
  10. * @copyright 2015 Designs & Code
  11. *
  12. * Note: these templates are not full page templates, rather
  13. * just an encaspulation of the your results loop which should
  14. * be inserted in to other pages by using a shortcode - think
  15. * of it as a template part
  16. *
  17. * This template is an absolute base example showing you what
  18. * you can do, for more customisation see the WordPress docs
  19. * and using template tags -
  20. *
  21. * http://codex.wordpress.org/Template_Tags
  22. *
  23. */
  24.  
  25. if ( $query->have_posts() )
  26. {
  27. ?>
  28. <div class="pagination">
  29.  
  30. <div class="nav-previous"><?php next_posts_link( 'Older posts', $query->max_num_pages ); ?></div>
  31. <div class="nav-next"><?php previous_posts_link( 'Newer posts' ); ?></div>
  32. <?php
  33. /* example code for using the wp_pagenavi plugin */
  34. if (function_exists('wp_pagenavi'))
  35. {
  36. echo "<br />";
  37. wp_pagenavi( array( 'query' => $query ) );
  38. }
  39. ?>
  40. </div>
  41.  
  42. <?php
  43. while ($query->have_posts())
  44. {
  45. $query->the_post();
  46.  
  47. ?>
  48. <div class="search-posts-result <?php the_author(); ?>">
  49. <a href="<?php the_permalink(); ?>" target="_blank" class="search-results-image"></a>
  50. <?php
  51. if ( has_post_thumbnail() ) {
  52. echo '<p>';
  53. the_post_thumbnail("small");
  54. echo '</a></p>';
  55. }
  56. ?>
  57. <h2><a href="<?php the_permalink(); ?>" target="_blank"><?php the_title(); ?></a></h2>
  58.  
  59. <div class="search-posts-date"><?php the_date(); ?></div>
  60. <div class="search-posts-content"><?php content('30'); ?> <a href="<?php the_permalink(); ?>" target="_blank"><span class="read-more-link">Read more...</a></span></div>
  61.  
  62. <div class="search-posts-author">from <?php the_author(); ?></div>
  63.  
  64. </div>
  65. <?php
  66. }
  67. ?>
  68.  
  69. <?php
  70. }
  71. else
  72. {
  73. echo "No Results Found";
  74. }
  75. ?>
Advertisement
Add Comment
Please, Sign In to add comment