Posts Tagged ‘pagination’

wordpress에서 page로 보이기

Friday, August 29th, 2008

wordpress 를 이용함에 있어서 한국 정서에 잘 맞지 않는 뷰가..
페이지별로 보이지 않고, “previous/next”로 보이는 것이라고 생각한다.
실제로 나도 “이전/다음”이면 이게 시간 순서상 최신인지 아닌지 헷갈릴 때가 많기 때문이다.
이글루스에 익숙한 사용자라면 그렇지 않겠지만.. ^^

그래서 page로 보이게 하는 plugin이 없나 보니, 꽤 많은 플러그인이 있었는데,
그 중에서 가장 간단한 것이 지금 설치한 WP-Digg Style Paginator이다.

간단한 설치법은 아래와 같다.

http://www.mis-algoritmos.com/2007/03/16/some-styles-for-your-pagination/ 에서 맘에 드는 css를 다운받아 워드프레스 테마(디자인) 디렉토리에 넣어준다.

페이지 뷰로 바꾸고 싶은 페이지에서
(예를 들면, 메인 페이지 index.php 부분을 바꾸고 싶다면 테마 디렉토리 안의 index.php를 수정한다)

<old/previous> 부분을 <pages> 로 바꾸어주어야 하는데..
index.php 안의 아래 내용을 주석 처리하고
 

  <div class="navigation">
	<div class="alignleft"><?php next_posts_link('&laquo; Older Entries') ?></div>
        <div class="alignright"><?php previous_posts_link('Newer Entries &raquo;') ?></div>
  </div>

대신 아래 부분을 삽입하면 된다.

        <?php
        $p = new wp_pagination_plugin();
        $p->nextLabel(''); // removing text 'next'
        $p->prevLabel(''); // removing text 'previous'
        $p->nextIcon('&#9658;'); // changing the icon 'next'
        $p->prevIcon('&#9668;'); // changing the previous 'icon'
        $p->show();
        ?>