Title: Custom category loop issues
Last modified: August 19, 2016

---

# Custom category loop issues

 *  [Everton](https://wordpress.org/support/users/everton/)
 * (@everton)
 * [16 years, 5 months ago](https://wordpress.org/support/topic/custom-category-loop-issues/)
 * Hi
 * I’m hoping someone here can help me please. I’ve created a custom category page
   that contains multiple loops e.g.
 * [http://windows7news.com/category/windows7-guides/](http://windows7news.com/category/windows7-guides/)
 * but when I use the pagination tool at the bottom to see the rest of the posts
   in that category it shows the same posts (the ones with thumbnails)again:
 * [http://windows7news.com/category/windows7-guides/page/2/](http://windows7news.com/category/windows7-guides/page/2/)
   
   [http://windows7news.com/category/windows7-guides/page/3/](http://windows7news.com/category/windows7-guides/page/3/)
 * How do i fix this? Here’s my full code-thanks in advance for any help.
 * EB
 * [moderated Please paste the code into a pastebin such as [wordpress.pastebin.ca](http://wordpress.pastebin.ca),
   and report the link back here.]]

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

 *  Thread Starter [Everton](https://wordpress.org/support/users/everton/)
 * (@everton)
 * [16 years, 5 months ago](https://wordpress.org/support/topic/custom-category-loop-issues/#post-1284361)
 * here’s the pastebin link:
 * [http://wordpress.pastebin.ca/1680292](http://wordpress.pastebin.ca/1680292)
 *  Thread Starter [Everton](https://wordpress.org/support/users/everton/)
 * (@everton)
 * [16 years, 5 months ago](https://wordpress.org/support/topic/custom-category-loop-issues/#post-1284493)
 * can anyone help?
 *  [MichaelH](https://wordpress.org/support/users/michaelh/)
 * (@michaelh)
 * [16 years, 5 months ago](https://wordpress.org/support/topic/custom-category-loop-issues/#post-1284495)
 * I don’t see any [previous_posts_link()](http://codex.wordpress.org/Template_Tags/previous_posts_link)
   and [next_posts_link()](http://codex.wordpress.org/Template_Tags/next_posts_link)
   constucts so look at the WordPress Default themes index.php for examples of those.
 * But you might try changing that last query from:
 *     ```
       <?php query_posts('category_name=windows7-guides'.'&paged=' . $paged); ?>
       ```
   
 * to
 *     ```
       <?php
       $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
       query_posts('category_name=windows7-guides'.'&paged=' . $paged);
       ?>
       ```
   
 *  Thread Starter [Everton](https://wordpress.org/support/users/everton/)
 * (@everton)
 * [16 years, 5 months ago](https://wordpress.org/support/topic/custom-category-loop-issues/#post-1284510)
 * Hi MichaelH
 * thanks for trying to help – same problem I’m afraid!
 * EB
 *  Thread Starter [Everton](https://wordpress.org/support/users/everton/)
 * (@everton)
 * [16 years, 5 months ago](https://wordpress.org/support/topic/custom-category-loop-issues/#post-1284521)
 * anybody have any other ideas?
 *  Thread Starter [Everton](https://wordpress.org/support/users/everton/)
 * (@everton)
 * [16 years, 5 months ago](https://wordpress.org/support/topic/custom-category-loop-issues/#post-1284538)
 * bump trying to keep this alive
 *  [MichaelH](https://wordpress.org/support/users/michaelh/)
 * (@michaelh)
 * [16 years, 5 months ago](https://wordpress.org/support/topic/custom-category-loop-issues/#post-1284539)
 * Seems you have plugins handling the navigation, and you’ve got includes in your
   loop, so maybe need to point you here:
 * [http://www.google.com/search?q=wordpress+pagination+and+query](http://www.google.com/search?q=wordpress+pagination+and+query)
 *  Thread Starter [Everton](https://wordpress.org/support/users/everton/)
 * (@everton)
 * [16 years, 5 months ago](https://wordpress.org/support/topic/custom-category-loop-issues/#post-1284543)
 * thanks for the advice of using google…can anyone provide any help that’s a bit
   more substantial?
 *  [Mark / t31os](https://wordpress.org/support/users/t31os_/)
 * (@t31os_)
 * [16 years, 5 months ago](https://wordpress.org/support/topic/custom-category-loop-issues/#post-1284544)
 * A good wealth of these would still be relevant.
    [http://wordpress.org/tags/pagination](http://wordpress.org/tags/pagination)
   [http://wordpress.org/tags/paged](http://wordpress.org/tags/paged)
 * The key here, as Michael has already shown in his initial response, is setting
   up the $paged variable, or at least the paged parameter inside the query_posts
   line, since this ultimately controls, and sets, the offset positions in the query,
   ie. your LIMIT clause in the end SQL query..
 * Ideally what i believe you should do, is drop the built-in paging and write your
   own. I say this simply because i don’t think query_posts is equipped to deal 
   with 4 queries (all using query_posts) and paging them..
 * You could look at plugins for examples, but i can’t say i know any particular
   plugins specifically that cover this (i’m sure it’s been done though).

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

The topic ‘Custom category loop issues’ is closed to new replies.

## Tags

 * [category](https://wordpress.org/support/topic-tag/category/)
 * [custom category](https://wordpress.org/support/topic-tag/custom-category/)
 * [loop](https://wordpress.org/support/topic-tag/loop/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 9 replies
 * 3 participants
 * Last reply from: [Mark / t31os](https://wordpress.org/support/users/t31os_/)
 * Last activity: [16 years, 5 months ago](https://wordpress.org/support/topic/custom-category-loop-issues/#post-1284544)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
