Title: pagination before loop
Last modified: August 21, 2016

---

# pagination before loop

 *  [zvrk](https://wordpress.org/support/users/zvrk/)
 * (@zvrk)
 * [12 years, 2 months ago](https://wordpress.org/support/topic/pagination-before-loop/)
 * i have custom loop with pagination,and pagination work after loop, but how i 
   can add pagination in header before loop start, can i add action and how? when
   loop finish to add prev link, next link in header

Viewing 1 replies (of 1 total)

 *  [The Grey Parrots](https://wordpress.org/support/users/greyparrots/)
 * (@greyparrots)
 * [12 years, 2 months ago](https://wordpress.org/support/topic/pagination-before-loop/#post-4730362)
 * Hi,
 * You have to do at least these before the pagination call.
 *     ```
       $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
       $new_query = new WP_Query();
       $new_query->query
       ```
   
 * You may display the loop element later on.

Viewing 1 replies (of 1 total)

The topic ‘pagination before loop’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 2 participants
 * Last reply from: [The Grey Parrots](https://wordpress.org/support/users/greyparrots/)
 * Last activity: [12 years, 2 months ago](https://wordpress.org/support/topic/pagination-before-loop/#post-4730362)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
