typecho 아카이브 페이지 페이지를 매기는 방법

WBOY
풀어 주다: 2016-10-10 11:55:59
원래의
2069명이 탐색했습니다.

typecho 아카이브 페이지의 기사 출력을 다음과 같이 썼습니다.

<code class="php"><?php
                    $this->widget('Widget_Contents_Post_Recent', 'pageSize=1000')->to($archives);
                    $year=0; $i=0; $j=0;
                    while($archives->next()):
                        $year_tmp = date('Y',$archives->created);
                        $y=$year;
                        if ($year != $year_tmp && $year > 0) $output .= '<div></div>';
                        if ($year != $year_tmp) {
                            $year = $year_tmp;
                            $output = '<h2 class="archive-year">'. $year .'</h2>';
                        }
                        $output .= '<a class="transition archive-iterm" href="'.$archives->permalink .'"><h3 class="archive-title">'. $archives->title .'</h3><p class="archive-date">'.date('F jS ',$archives->created).'</p></a>';
                    endwhile;
                    
                    echo $output;
                ?></code>
로그인 후 복사
로그인 후 복사

페이지를 매길 수 없는데 어떻게 해야 하나요?

답글 내용:

typecho 아카이브 페이지의 기사 출력을 다음과 같이 썼습니다.

<code class="php"><?php
                    $this->widget('Widget_Contents_Post_Recent', 'pageSize=1000')->to($archives);
                    $year=0; $i=0; $j=0;
                    while($archives->next()):
                        $year_tmp = date('Y',$archives->created);
                        $y=$year;
                        if ($year != $year_tmp && $year > 0) $output .= '<div></div>';
                        if ($year != $year_tmp) {
                            $year = $year_tmp;
                            $output = '<h2 class="archive-year">'. $year .'</h2>';
                        }
                        $output .= '<a class="transition archive-iterm" href="'.$archives->permalink .'"><h3 class="archive-title">'. $archives->title .'</h3><p class="archive-date">'.date('F jS ',$archives->created).'</p></a>';
                    endwhile;
                    
                    echo $output;
                ?></code>
로그인 후 복사
로그인 후 복사

페이지를 매길 수 없는데 어떻게 해야 하나요?

어떤 종류의 페이지네이션이 있나요?

관련 라벨:
원천:php.cn
본 웹사이트의 성명
본 글의 내용은 네티즌들의 자발적인 기여로 작성되었으며, 저작권은 원저작자에게 있습니다. 본 사이트는 이에 상응하는 법적 책임을 지지 않습니다. 표절이나 침해가 의심되는 콘텐츠를 발견한 경우 admin@php.cn으로 문의하세요.
인기 튜토리얼
더>
최신 다운로드
더>
웹 효과
웹사이트 소스 코드
웹사이트 자료
프론트엔드 템플릿
회사 소개 부인 성명 Sitemap
PHP 중국어 웹사이트:공공복지 온라인 PHP 교육,PHP 학습자의 빠른 성장을 도와주세요!