Title: [Plugin: WP-Paginate] wrong link
Last modified: August 19, 2016

---

# [Plugin: WP-Paginate] wrong link

 *  Resolved [emi662002](https://wordpress.org/support/users/emi662002/)
 * (@emi662002)
 * [15 years, 2 months ago](https://wordpress.org/support/topic/plugin-wp-paginate-wrong-link-1/)
 * Hi! I’m working with this plugin and i have a problem:
 * for posts in categories (not at home) and this happens only in the web server,
   on my local development server i dont have this problem:
    the next link href 
   is: /?cat=3%3Fcat%3D3&paged=2
 * as you can notice, the ‘?cat=3’ its repeated and url encoded cause there already
   is a ‘?’ for the querystring
 * any ideas??
 * Thanks in advance!!

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

 *  Thread Starter [emi662002](https://wordpress.org/support/users/emi662002/)
 * (@emi662002)
 * [15 years, 2 months ago](https://wordpress.org/support/topic/plugin-wp-paginate-wrong-link-1/#post-1986038)
 * and also this happens only in the first page, if i go to another page writing
   the right link, i can go back and forth with no problems
 *  Thread Starter [emi662002](https://wordpress.org/support/users/emi662002/)
 * (@emi662002)
 * [15 years, 2 months ago](https://wordpress.org/support/topic/plugin-wp-paginate-wrong-link-1/#post-1986042)
 * i figured out a way to fix it, inside the plugin
 * it appears to be a problem with the
 * `esc_url(get_pagenum_link($page + 1)`
 * this is the fix
 *     ```
       $nextlink = ($this->type === 'posts')
       				? esc_url(get_pagenum_link($page + 1))
       				: get_comments_pagenum_link($page + 1);
   
       			if($page == 1 && $this->type === 'posts' && $_GET['cat'] != ""){
       				$nueva_pag = get_query_var('paged') + 1;
       				$nextlink = get_category_link($_GET['cat']) . "&paged=" . $nueva_pag;
       			}
       ```
   
 * and the same for the loop for the links
 *  Plugin Author [Eric](https://wordpress.org/support/users/emartin24/)
 * (@emartin24)
 * [15 years, 2 months ago](https://wordpress.org/support/topic/plugin-wp-paginate-wrong-link-1/#post-1986128)
 * WP-Paginate is using the internal WP functions, so I’m not sure that it is an
   issue with the plugin, but perhaps WP or your code?
 *  Thread Starter [emi662002](https://wordpress.org/support/users/emi662002/)
 * (@emi662002)
 * [15 years, 2 months ago](https://wordpress.org/support/topic/plugin-wp-paginate-wrong-link-1/#post-1986130)
 * yes, i noticed so while i was trying to figure out what was wrong.
 * maybe its something with my loop, cause i have a customized query. it works now
   with the fix mentioned above, i know its not the best solution, and its not recommended
   but its the easiest until i can go further with the investigation.
 * Thanks for the reply!

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

The topic ‘[Plugin: WP-Paginate] wrong link’ is closed to new replies.

 * ![](https://ps.w.org/wp-paginate/assets/icon-128x128.png?rev=1566512)
 * [WP-Paginate](https://wordpress.org/plugins/wp-paginate/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-paginate/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-paginate/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-paginate/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-paginate/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-paginate/reviews/)

 * 4 replies
 * 2 participants
 * Last reply from: [emi662002](https://wordpress.org/support/users/emi662002/)
 * Last activity: [15 years, 2 months ago](https://wordpress.org/support/topic/plugin-wp-paginate-wrong-link-1/#post-1986130)
 * Status: resolved