Advertisement
Guest User

Untitled

a guest
Sep 30th, 2014
217
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.28 KB | None | 0 0
  1. if (have_posts()) :
  2.  
  3. $args = array(
  4. 'showposts' => '5',
  5. 'paged' => $paged
  6. );
  7.  
  8.  
  9. $thePosts = query_posts($args);
  10. ...
  11.  
  12. if (have_posts()) :
  13.  
  14. $args = array(
  15. 'showposts' => '5',
  16. 'paged' => $paged
  17. );
  18.  
  19.  
  20. $thePosts = query_posts($args);
  21.  
  22.  
  23. global $wp_query;
  24. echo $wp_query->found_posts;
  25. ...
  26.  
  27. Search Result for
  28.  
  29. <?php
  30. /* Search Count */
  31. $allsearch = &new WP_Query("s=$s&showposts=-1");
  32. $key = wp_specialchars($s, 1);
  33. $count = $allsearch->post_count; _e('');
  34. _e('<span class="search-terms">');
  35. echo $key; _e('</span>');
  36. _e(' &mdash; ');
  37. echo $count . ' ';
  38. _e('articles');
  39. wp_reset_query();
  40. ?>
  41.  
  42. $args = array(
  43. 'cat'=> $cat,
  44. 'posts_per_page' => 10,
  45. 'paged' => $paged,
  46. 's'=> $s
  47. );
  48. query_posts($args);
  49.  
  50. $startpost=1;
  51. $startpost=10*($paged - 1)+1;
  52. $endpost = (10*$paged < $wp_query->found_posts ? 10*$paged : $wp_query->found_posts);
  53. ?>
  54. <h2 class="displayResult">Showing results <?php echo $startpost; ?> - <?php echo $endpost; ?> of <?php echo $wp_query->found_posts; ?></h2>
  55.  
  56. if (have_posts()) :
  57.  
  58. $args = array(
  59. 'showposts' => '5',
  60. 'paged' => $paged
  61. );
  62.  
  63.  
  64. $thePosts = query_posts($args);
  65.  
  66.  
  67.  
  68. echo $thePosts ->found_posts;
  69. ...
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement