Problems in paginate_links with custom query loop and MB-Relationships

Im having some troubles with paginate_links.Im using the plugin MB-Relationships, and 2 custom-post-types: Artist and A

Im having some troubles with paginate_links. Im using the plugin MB-Relationships, and 2 custom-post-types: Artist and Artworks.

On the single-artist I need to do a Query to show all the artworks related to that Artists. This is working well, but the paginate_links seens a little bit odd. I´ve oppened an issue on Mb-relationships github page: and tried to use page instead of paged

This is my paginate_links configuration:

$pages = paginate_links([
        //'base' => str_replace(999999999, '%#%', esc_url(get_pagenum_link(999999999))),
        'format' => '?page=%#%',
        'current' => max(1, get_query_var('page')),
        'total' => $wp_query->max_num_pages,
        'type' => 'array',
        'show_all' => false,
        'end_size' => 2,
        'mid_size' => 1,
        'prev_next' => true,
        'prev_text' => __('«'),
        'next_text' => __('»'),
        'add_args' => false,
        'add_fragment' => '',
    ]
    );
    var_dump($pages);

The var_dump echoes this:

/app/public/wp-content/themes/wiki-ema-template/inc/numeric-pagination/wp-bootstrap4.1-pagination.php:47:
array (size=8)
0 => string '<a class="prev page-numbers" href="/wiki-ema/autor/autor-desconhecido/2/">&laquo;</a>' (length=106)
  1 => string '<a class='page-numbers' href='/wiki-ema/autor/autor-desconhecido/2/'>1</a>' (length=95)
  2 => string '<span aria-current='page' class='page-numbers current'>2</span>' (length=63)
  3 => string '<a class='page-numbers' href='/wiki-ema/autor/autor-desconhecido/2/?page=3'>3</a>' (length=102)
  4 => string '<span class="page-numbers dots">&hellip;</span>' (length=47)
  5 => string '<a class='page-numbers' href='/wiki-ema/autor/autor-desconhecido/2/?page=82'>82</a>' (length=104)
  6 => string '<a class='page-numbers' href='/wiki-ema/autor/autor-desconhecido/2/?page=83'>83</a>' (length=104)
  7 => string '<a class="next page-numbers" href="/wiki-ema/autor/autor-desconhecido/2/?page=3">&raquo;</a>' (length=113)

The problem resides on the number 1 link that gives me a URL without the /?page=1, this link, when clicked, reload the same page.

When I uncomment the 'base' configuration it gives me the URL with the page/%_% that sends me to a 404 page.

All the other number are working just fine. Only the link to number 1 page is not working.

Could someone give me a light on that?

Thank you!

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745310234a4621960.html

相关推荐

  • Problems in paginate_links with custom query loop and MB-Relationships

    Im having some troubles with paginate_links.Im using the plugin MB-Relationships, and 2 custom-post-types: Artist and A

    9小时前
    20

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信