wp query - Pagination unique to a widget

I am having troubles with pagination. It's widget. Every widget does have unique id . Say i have two widgets with p

I am having troubles with pagination. It's widget. Every widget does have unique id . Say i have two widgets with pagination. If I cick page 2 of widget 2 then it will work but it will change the pagination of first one too.

$paged_id = $this->get_id();
$paged_query_var = 'paged'.$paged_id;
//var_dump($paged_id);
$paged_bottom = (get_query_var($paged_query_var)) ? absint(get_query_var($paged_query_var)) : 1;
$paged_bottom_args  = array(
  'format'    => '?paged'.$paged_id.'=%#%',
  'current'   => intval($paged_bottom),
  'total'     => intval($query->max_num_pages),
  'mid_size'  => $pagination_midsize,
  'prev_text' => '<i class="fa fa-arrow-left"></i>',
  'next_text' => '<i class="fa fa-arrow-right"></i>',
);
echo paginate_links($paged_bottom_args);

this is what i tried but it does not work as get_query_var will not have variable in it. This is some thing dynamic so i am not able to set the variable for get_query_var using the filter.

Is there any way?

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

相关推荐

  • wp query - Pagination unique to a widget

    I am having troubles with pagination. It's widget. Every widget does have unique id . Say i have two widgets with p

    2天前
    20

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

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

关注微信