Pagination link problem. (5 posts)

  1. netinial
    Posted 5 years ago #


    I have a new query inside the page.

    When I call wp_pagenavi from http://test.com/net/x-page this adress

    it creates me page adresses like http://test.com/net/x-page/page2
    http://test.com/net/x-page/page3 etc..

    I want to change this adress's to http://test.com/c/yc/page2
    http://test.com/c/yc/page3 to prevent dublicate content. to link it (category)

    I found that this adress given by get_pagenum_link( $page ) function from wordpress to the wp_pagenavi.

    And get_pagenum_link function uses remove_query_arg to obtain this adress.

    But this process being before all query.

    So how can I change this adress from net/x-page/page2 to /c/yc/page2

    If I cannot solve the problem I will redirect net/x-page/page2 page to the /c/yc/page2 but this will not solve my problem because I want to show page's content in first page.

    Are there any solution

  2. scribu
    Plugin Author

    Posted 5 years ago #

    It would involve some serious hacking of $wp_rewrite and other bits of WordPress, which might break other things. I don't think it's worth the hassle.

    I would just use a NOINDEX meta tag or a rel=canonical instead.

  3. netinial
    Posted 5 years ago #

    Dear scribu

    thank you for your answer.

    Actually I have such a problem.

    I'm calling 2 loop in one page while creating this result.

    first loop is regular,

    <?php while (have_posts()) : the_post(); ?>
    <div <?php post_class() ?> id="post-<?php the_ID(); ?>">
    <?php endwhile; ?>

    when loop finish I call new loop.

    <?php if (is_page(array('gulets'))) : ?>
    $query_inside_page = 'cat=15&showposts=15';
    include "boat-list-yb.php";
    <?php endif; ?>

    Even I use wp_reset_query() or $wp_query = null; it is gives me still gulets adress. http://test.com/gulets/page2

    Are there any way to isolate 1st loop from main loop. So I just want to take adress of regular category list

    http://test.com/category/yc/page1 etc.

  4. scribu
    Plugin Author

    Posted 5 years ago #

  5. netinial
    Posted 5 years ago #


    Ok but wp_pagenavi looking for main loop.
    So it is not effecting any result.

    Even I try

    $wp_query = new WP_Query();

    while ($wp_query->have_posts()) : $wp_query->the_post();

    No luck. Are not there any solution to pass another loop to the wp_pagenavi (except of main loop) ?

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic