首頁  >  問答  >  主體

wordpress php 分頁出現亂碼

請問是哪裡出現問題了麼

    function wp_admin_pagenavi($total_count, $number_per_page=20){
    
        $current_page = isset($_GET['paged'])?$_GET['paged']:1;
    
        if(isset($_GET['paged'])){
            unset($_GET['paged']);
        }
    
        $base_url = add_query_arg($_GET,admin_url('admin.php'));
    
        $total_pages    = ceil($total_count/$number_per_page);
    
        $first_page_url    = $base_url.'&paged=1';
        $last_page_url    = $base_url.'&paged='.$total_pages;
        
        if($current_page > 1 && $current_page < $total_pages){
            $prev_page        = $current_page-1;
            $prev_page_url    = $base_url.'&amp;paged='.$prev_page;
    
            $next_page        = $current_page+1;
            $next_page_url    = $base_url.'&amp;paged='.$next_page;
            $last_page_url    = $base_url.'&amp;paged='.$total_pages;
        }elseif($current_page == 1){
            $prev_page_url    = '#';
            $first_page_url    = '#';
            if($total_pages > 1){
                $next_page        = $current_page+1;
                $next_page_url    = $base_url.'&amp;paged='.$next_page;
            }else{
                $next_page_url    = '#';
            }
        }elseif($current_page == $total_pages){
            $prev_page        = $current_page-1;
            $prev_page_url    = $base_url.'&amp;paged='.$prev_page;
            $next_page_url    = '#';
            $last_page_url    = '#';
        }
        

##
伊谢尔伦伊谢尔伦2726 天前494

全部回覆(1)我來回復

  • 给我你的怀抱

    给我你的怀抱2017-05-27 17:45:38

    編碼集是否改了啊

    回覆
    0
  • 取消回覆