Title: query_posts &quot;showposts=&quot; not working
Last modified: August 19, 2016

---

# query_posts "showposts=" not working

 *  [patricia1706](https://wordpress.org/support/users/patricia1706/)
 * (@patricia1706)
 * [15 years, 5 months ago](https://wordpress.org/support/topic/query_posts-showposts-not-working/)
 * I have a multilingual site (WPML) for which I need to insert a manual query. 
   The ‘showposts=??’ operation is not working, in the code example below. Any thoughts?
   Thanks in advance!
 *     ```
       <?php
         if (ICL_LANGUAGE_CODE == 'en') {
        	$categories = get_categories("child_of=7&showposts=3&orderby=ID&exclude=40,38,41,42");
       	echo '<h3>English Title</h3>';
   
         } elseif (ICL_LANGUAGE_CODE == 'es') {
        $categories = get_categories("child_of=10&showposts=3&orderby=ID&exclude=39,43,44,45");
           echo '<h3>Spanish Title</h3>';
         }
       ?>
       		<?php foreach ($categories as $cat) { ?>
               <?php query_posts("cat=$cat->cat_ID&showposts=6"); ?>
   
       	<Do stuff>
   
       <?php }?>
       ```
   

Viewing 1 replies (of 1 total)

 *  [Michael](https://wordpress.org/support/users/alchymyth/)
 * (@alchymyth)
 * [15 years, 5 months ago](https://wordpress.org/support/topic/query_posts-showposts-not-working/#post-1846588)
 * `get_categories()` does not have a parameter ‘showposts’
 * [http://codex.wordpress.org/Function_Reference/get_categories](http://codex.wordpress.org/Function_Reference/get_categories)
 * what is the more precise description of ‘not working’?
 * does <Do stuff> include a wordpress loop?

Viewing 1 replies (of 1 total)

The topic ‘query_posts "showposts=" not working’ is closed to new replies.

 * 1 reply
 * 2 participants
 * Last reply from: [Michael](https://wordpress.org/support/users/alchymyth/)
 * Last activity: [15 years, 5 months ago](https://wordpress.org/support/topic/query_posts-showposts-not-working/#post-1846588)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
