profil77

Untitled

Apr 22nd, 2015
304
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.26 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 2014 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.  
  29. Found <?php echo $query->found_posts; ?> Results<br />
  30. Page <?php echo $query->query['paged']; ?> of <?php echo $query->max_num_pages; ?><br />
  31.  
  32. <div class="pagination">
  33.  
  34. <div class="nav-previous"><?php next_posts_link( 'Older posts', $query->max_num_pages ); ?></div>
  35. <div class="nav-next"><?php previous_posts_link( 'Newer posts' ); ?></div>
  36. <?php
  37. /* example code for using the wp_pagenavi plugin */
  38. if (function_exists('wp_pagenavi'))
  39. {
  40. echo "<br />";
  41. wp_pagenavi( array( 'query' => $query ) );
  42. }
  43. ?>
  44. </div>
  45.  
  46. <?php
  47. while ($query->have_posts())
  48. {
  49. $query->the_post();
  50.  
  51. ?>
  52. <div>
  53. <h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
  54.  
  55. <p><br /><?php the_excerpt(); ?><p>
  56. <?php
  57. if ( has_post_thumbnail() ) {
  58. echo '<p>';
  59. the_post_thumbnail("small");
  60. echo '</p>';
  61. }
  62. ?>
  63. <p><?php the_category(); ?><p>
  64. <p><?php the_tags(); ?><p>
  65. <p><small><?php the_date(); ?></small><p>
  66.  
  67. </div>
  68.  
  69. <hr />
  70. <?php
  71. }
  72. ?>
  73. Page <?php echo $query->query['paged']; ?> of <?php echo $query->max_num_pages; ?><br />
  74.  
  75. <div class="pagination">
  76.  
  77. <div class="nav-previous"><?php next_posts_link( 'Older posts', $query->max_num_pages ); ?></div>
  78. <div class="nav-next"><?php previous_posts_link( 'Newer posts' ); ?></div>
  79. <?php
  80. /* example code for using the wp_pagenavi plugin */
  81. if (function_exists('wp_pagenavi'))
  82. {
  83. echo "<br />";
  84. wp_pagenavi( array( 'query' => $query ) );
  85. }
  86. ?>
  87. </div>
  88. <?php
  89. }
  90. else
  91. {
  92. echo "No Results Found";
  93. }
  94. ?>
Advertisement
Add Comment
Please, Sign In to add comment