WordPress.org

Ready to get started?Download WordPress

Forums

WP-Paginate
[resolved] wrong link (5 posts)

  1. emi662002
    Member
    Posted 3 years ago #

    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!!

  2. emi662002
    Member
    Posted 3 years ago #

    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

  3. emi662002
    Member
    Posted 3 years ago #

    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

  4. Eric Martin
    Member
    Plugin Author

    Posted 3 years ago #

    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?

  5. emi662002
    Member
    Posted 3 years ago #

    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!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic