wordpress分页从url获取当前页码 [英] wordpress pagination get current page number from url

查看:38
本文介绍了wordpress分页从url获取当前页码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要从这个 url 中提取page"的值,即 5 - http://snypher.本地/照片/页面/5我应该怎么做才能在 Wordpress 中提取它?我无法从 $_GET 超级全局获取它.

I need to extract the value of "page" i.e 5 from this url - http://snypher.local/photos/page/5 What should I do to extract it in Wordpress? I am not able to get it from the $_GET super global.

推荐答案

use get_query_var 示例 $page = get_query_var('paged'); 在你的情况下它是 5

use get_query_var example $page = get_query_var('paged'); in your case it's 5

这篇关于wordpress分页从url获取当前页码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆