Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/wordpress/13.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
分页链接不工作-Wordpress_Wordpress_Pagination - Fatal编程技术网

分页链接不工作-Wordpress

分页链接不工作-Wordpress,wordpress,pagination,Wordpress,Pagination,我有一个wordpress主页的问题,特别优惠分页不工作,按照链接和代码 如果单击第2页,列出的产品是相同的 函数atpmenutypepagination($range=2,$pages=''){ 全局$paged,$wp\u查询; $out=''; $showitems=($range*2)+1; 如果(空($paged))$paged=1; 如果($pages==''){ $pages=$wp\u query->max\u num\u pages; 如果(!$页){ $pages=1;

我有一个wordpress主页的问题,特别优惠分页不工作,按照链接和代码

如果单击第2页,列出的产品是相同的

函数atpmenutypepagination($range=2,$pages=''){
全局$paged,$wp\u查询;
$out='';
$showitems=($range*2)+1;
如果(空($paged))$paged=1;
如果($pages==''){
$pages=$wp\u query->max\u num\u pages;
如果(!$页){
$pages=1;
}     
}   
//如果页面不止一个
如果(1!=$pages){
$out.='
页码“.$paged.”de“.$pages。
'';
如果($paged>2&&$paged>$range+1&&$showitems<$pages)$out.='';
如果($paged>1&&$showitems<$pages)$out.='';

对于($i=1;$i=$paged+$range+1 | |$i),为什么要链接到正在构建的页面?现在可以访问,请删除临时文件。谢谢。
function atpmenutypepagination($range =2,$pages = '') { 

    global $paged,$wp_query;
    $out='';
    $showitems = ($range * 2)+1;       
    if(empty($paged)) $paged = 1;
    if($pages == ''){
        $pages = $wp_query->max_num_pages;
        if(!$pages){
            $pages = 1; 
        }     
    }   

    //if pages more than one
    if(1 != $pages){
        $out.='<div class="pagination wp-pagenavi">
                <span class="pages extend">
                    Pag '.$paged.'  de  '.$pages.
                '</span>';
        if($paged > 2 && $paged > $range+1 && $showitems < $pages) $out.='<a href="'.get_pagenum_link(1).'">&laquo;</a>';
        if($paged > 1 && $showitems < $pages) $out.='<a href="'.get_pagenum_link($paged - 1).'">&lsaquo;</a>';
        for ($i=1; $i <= $pages; $i++){
            if (1 != $pages &&( !($i >= $paged+$range+1 || $i <= $paged-$range-1) || $pages <= $showitems ))  {
                $out.=($paged == $i)? '<span class="current">'.$i.'</span>':'<a href="'.get_pagenum_link($i).'" class="inactive" >'.$i.'</a>';
            }
        }

        if ($paged < $pages && $showitems < $pages) $out.='<a href="'.get_pagenum_link($paged + 1).'">&rsaquo;</a>';  
        if ($paged < $pages-1 &&  $paged+$range-1 < $pages && $showitems < $pages) $out.='<a href="'.get_pagenum_link($pages).'">&raquo;</a>';
        $out.= '</div>';
    }
    return $out;
}//end of function atpmenutypepagination