如何在wordpress静态页面中添加分页?
伙计们,我只是想问一下,如何在wordpress静态页面中添加分页,比如关于我们的页面。事实上,我只是在静态页面中添加帖子,但它只显示少数帖子。我想要所有帖子,这就是我需要分页的原因。请记住,我只是询问静态页面中的分页,而不是类别中的分页。我在您的帖子中没有看到任何代码。我已经用我自己的方式做了,看看这个如何在wordpress静态页面中添加分页?,wordpress,Wordpress,伙计们,我只是想问一下,如何在wordpress静态页面中添加分页,比如关于我们的页面。事实上,我只是在静态页面中添加帖子,但它只显示少数帖子。我想要所有帖子,这就是我需要分页的原因。请记住,我只是询问静态页面中的分页,而不是类别中的分页。我在您的帖子中没有看到任何代码。我已经用我自己的方式做了,看看这个 //grab the URL into a string variable (i.e., "yoursite.com/page/2" ) $strURL = $_SERVER['REQUEST
//grab the URL into a string variable (i.e., "yoursite.com/page/2" )
$strURL = $_SERVER['REQUEST_URI'];
//array the elements in the string btwn "/" (i.e. [page], [2] )
$arrVals = split("/",$strURL);
//boolean var used to alert when the integer page var is next
$intnextone = 0;
//integer variable for pagenumber
$intpagenum = 0;
// loop through the array
foreach ($arrVals as $value) {
if ($intnextone == 1){$intpagenum=$value;} // assign var
if ($value == "page") {$intnextone =1;} //next loop is int
}
谢谢。我在你的帖子中没有看到任何代码。我已经用我自己的方式做了,看看这个
//grab the URL into a string variable (i.e., "yoursite.com/page/2" )
$strURL = $_SERVER['REQUEST_URI'];
//array the elements in the string btwn "/" (i.e. [page], [2] )
$arrVals = split("/",$strURL);
//boolean var used to alert when the integer page var is next
$intnextone = 0;
//integer variable for pagenumber
$intpagenum = 0;
// loop through the array
foreach ($arrVals as $value) {
if ($intnextone == 1){$intpagenum=$value;} // assign var
if ($value == "page") {$intnextone =1;} //next loop is int
}
谢谢。您如何查询这些帖子?你能展示一些代码吗?你是如何查询帖子的?你能展示一些代码吗?