简体   繁体   English

wordpress paginate_links网址

[英]wordpress paginate_links url

my code looks like this: 我的代码如下所示:

paginate_links( 
  array(
   'next_text' => __('>'), 
   'prev_text' => __('<'), 
   'base' => @add_query_arg('page', '%#%'), 
   'format' => '?page=%#%&a='.$a, 
   'total' => ceil($count/$per_page), 
   'current' => $page)
)

Everything works perfectly but if I click on for example second page my url goes to www.domain.com/something/2/?a=5 instead of www.domain.com/something/?page=2&a=5 一切正常,但是如果我单击例如第二页,我的网址将转到www.domain.com/something/2/?a=5而不是www.domain.com/something/?page=2&a=5

Is it possible to change it into www.domain.com/something/?page=2&a=5 ? 是否可以将其更改为www.domain.com/something/?page=2&a=5

It is because you use permalinks : 这是因为您使用了永久链接:

format (string) (optional) Used for Pagination structure. 格式(字符串)(可选)用于分页结构。 The default value is '?page=%#%', If using pretty permalinks this would be '/page/%#%', where the '%#%' is replaced by the page number. 默认值为'?page =%#%'。如果使用漂亮的永久链接,则为'/ page /%#%',其中'%#%'被替换为页码。 Default: '?page=%#%' 默认值:“?page =%#%”

Just rename the var page into something else 只需将var页面重命名为其他内容

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM