Title: limit taxonomy result
Last modified: August 20, 2016

---

# limit taxonomy result

 *  [dado_it](https://wordpress.org/support/users/dado_it/)
 * (@dado_it)
 * [13 years, 5 months ago](https://wordpress.org/support/topic/limit-taxonomy-result/)
 * Hi, this is my first post.
    I can not resolve my problem with taxonomy page. 
   I’d like to hove just 5 post per page, this is my code
 *     ```
       <div id="content">
   
       <?php if (have_posts()) : ?>
        <?php while ($wp_query->have_posts()) : $wp_query->the_post(); ?>
         <div class="carbox clearfix" id="post-<?php the_ID(); ?>">
            <em>do something</em>
         </div>
        <?php endwhile; ?>
         <?php getpagenavi(); ?>
       <?php else : ?>
       	<h1 class="title">Not Found</h1>
       	<p>Sorry, but you are looking for something that isn't here.</p>
       <?php endif; ?>
       ```
   
 * Does anyone have a solution?
    Thanks

Viewing 10 replies - 1 through 10 (of 10 total)

 *  [vtxyzzy](https://wordpress.org/support/users/vtxyzzy/)
 * (@vtxyzzy)
 * [13 years, 5 months ago](https://wordpress.org/support/topic/limit-taxonomy-result/#post-3215897)
 * Try replacing this:
 *     ```
       <?php if (have_posts()) : ?>
       ```
   
 * with this:
 *     ```
       <?php global $wp_query;
       query_posts(
          array_merge(
             $wp_query->query,
             array('posts_per_page' => 5)
          )
       );
       if (have_posts()) : ?>
       ```
   
 *  Thread Starter [dado_it](https://wordpress.org/support/users/dado_it/)
 * (@dado_it)
 * [13 years, 5 months ago](https://wordpress.org/support/topic/limit-taxonomy-result/#post-3215905)
 * Thanks, it works.
    But I don’t understand why the paginations doesn’t work. For
   the first result I have `www.test.it/?condition=usato` (and all it’s ok) but 
   when I click on second page `www.test.it/?condition=usato&paged=2` is a **404
   not found page**
 * why?
    thanks a lot
 *  [vtxyzzy](https://wordpress.org/support/users/vtxyzzy/)
 * (@vtxyzzy)
 * [13 years, 5 months ago](https://wordpress.org/support/topic/limit-taxonomy-result/#post-3215908)
 * I am not familiar with the getpagenavi() function.
 * First, try adding the paged arg to the query. Change this:
 *     ```
       <?php global $wp_query;
       query_posts(
          array_merge(
             $wp_query->query,
             array('posts_per_page' => 5)
          )
       );
       ```
   
 * to this:
 *     ```
       <?php global $wp_query;
       $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
       query_posts(
          array_merge(
             $wp_query->query,
             array('posts_per_page' => 5,
                   'paged' => $paged )
          )
       );
       ```
   
 * If that does not work, and you are using a free theme, post a link to its download
   site so I can examine the code. If it is a paid theme, you will need to ask the
   theme supplier.
 *  Thread Starter [dado_it](https://wordpress.org/support/users/dado_it/)
 * (@dado_it)
 * [13 years, 5 months ago](https://wordpress.org/support/topic/limit-taxonomy-result/#post-3215909)
 * thank you for helping me, but doesn’t work.
    Here you can download the free theme,
   the page is taxonomy.php [gears](http://www.fabthemes.com/gears/)
 * many thanks
 *  [vtxyzzy](https://wordpress.org/support/users/vtxyzzy/)
 * (@vtxyzzy)
 * [13 years, 5 months ago](https://wordpress.org/support/topic/limit-taxonomy-result/#post-3215910)
 * I don’t see anything obvious in the theme. Can you post a link to your site?
 * Also, try saving the permalinks settings under Admin->Settings->Permalinks.
 *  Thread Starter [dado_it](https://wordpress.org/support/users/dado_it/)
 * (@dado_it)
 * [13 years, 5 months ago](https://wordpress.org/support/topic/limit-taxonomy-result/#post-3215911)
 * This is my[ site](http://www.miniworldcar.it/)
    You can see the main menu on “
   minicar usage”, there is the taxonomy page where the paging doesn’t work. If 
   you want I give you wp user to see the code Thanks
 *  [vtxyzzy](https://wordpress.org/support/users/vtxyzzy/)
 * (@vtxyzzy)
 * [13 years, 5 months ago](https://wordpress.org/support/topic/limit-taxonomy-result/#post-3215912)
 * I still don’t see anything obvious. Please try setting the permalinks to the 
   default.
 *  Thread Starter [dado_it](https://wordpress.org/support/users/dado_it/)
 * (@dado_it)
 * [13 years, 5 months ago](https://wordpress.org/support/topic/limit-taxonomy-result/#post-3215913)
 * permalinks is on default and doesn’t work
    see [it](http://www.miniworldcar.it/?condition=usato&paged=2)
 * have you an email so I send you the wpuser?
 *  [vtxyzzy](https://wordpress.org/support/users/vtxyzzy/)
 * (@vtxyzzy)
 * [13 years, 5 months ago](https://wordpress.org/support/topic/limit-taxonomy-result/#post-3215914)
 * See my website [here](http://wordpress.mcdspot.com/contact-me).
 *  Thread Starter [dado_it](https://wordpress.org/support/users/dado_it/)
 * (@dado_it)
 * [13 years, 5 months ago](https://wordpress.org/support/topic/limit-taxonomy-result/#post-3215915)
 * ok, you have a mail

Viewing 10 replies - 1 through 10 (of 10 total)

The topic ‘limit taxonomy result’ is closed to new replies.

## Tags

 * [limit](https://wordpress.org/support/topic-tag/limit/)
 * [result](https://wordpress.org/support/topic-tag/result/)
 * [taxonomy](https://wordpress.org/support/topic-tag/taxonomy/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 10 replies
 * 2 participants
 * Last reply from: [dado_it](https://wordpress.org/support/users/dado_it/)
 * Last activity: [13 years, 5 months ago](https://wordpress.org/support/topic/limit-taxonomy-result/#post-3215915)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
