Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/wordpress/12.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 自定义wordpress插件后端分页_Php_Wordpress_Plugins_Pagination - Fatal编程技术网

Php 自定义wordpress插件后端分页

Php 自定义wordpress插件后端分页,php,wordpress,plugins,pagination,Php,Wordpress,Plugins,Pagination,我有一个自定义插件,其中有很多表。这就是我需要正确分页的原因。 现在我有一个分页,但它连续显示所有1到80。 这是分页的代码 <?php echo '<div id="pager">Page : <div class="btn-group">'; while( $loopLimit != $loopStart ) { echo '<a class="btn" href="admin.php?page=wp-glossary&requireTa

我有一个自定义插件,其中有很多表。这就是我需要正确分页的原因。 现在我有一个分页,但它连续显示所有1到80。 这是分页的代码

<?php

echo '<div id="pager">Page : <div class="btn-group">';
while( $loopLimit != $loopStart )
{
    echo '<a class="btn" href="admin.php?page=wp-glossary&requireTab=viewDelEditWord&totalItems='.$totalItems.'&currentPage='.$loopStart.'&orderByWord='.$_REQUEST["orderByWord"].'"';
    if ($loopStart == $currentPage) {echo ' id="activeParer"';}
    echo '>'.$loopStart.'</a>';
    $loopStart ++ ;
}
echo '</div></div>';

?>
以下是当前的钉扎视图:

我想要这样的1234…101112。我如何改变这个。
有什么想法吗

请尝试以下代码。如果有,请告诉我

    echo '<div id="pager">Page : <div class="btn-group">';
$loopStart = 1;
$currentPage = 4;
$loopLimit = 100;
$start_number_diplay = 5; // Number where you display in paganation in start and end.
$middle_number_diplay = 3;
$i = $j = 1; $total_pagination_display = 10;
while( $loopLimit != $loopStart )
{
    if( ($loopStart == ($start_number_diplay+1))  || ($total_pagination_display == $j)) {
        echo '<a class="btn" >...</a>';
        $j++;

    }

    echo '<a class="btn" href=""';
    if ($loopStart == $currentPage) {
        echo ' id="activeParer"';
    }
    if(($loopStart <= $start_number_diplay) ) {

        echo '>'.$loopStart.' </a>';
        $j++;

    }
    else if( (($loopStart%10) == 0) && ($i <= $middle_number_diplay) ) {
        echo '>'.$loopStart.' </a>';
        $i++;
        $j++;
    }
    $loopStart ++ ;

}
echo '</div></div>';

谢谢你的回复。它不能正常工作。添加此代码后,它看起来像这样的图像:但我想像这样的标准分页:请给我一个最好的过程。再次感谢。@Hossen先生请检查更新的代码,我只做了示例代码。请使用合适的代码进行更改。