Skip to content

Simple Yearly Archives

어떤 기능이 있는 Archives Plugin을 찾다가..
여러가지를 테스트 해보니 이넘이 에러도 없고 설정하기도 편해서 이넘으로 바로 교체했다.

<Simple Yearly Archives>


워프 링크: http://wordpress.org/extend/plugins/simple-yearly-archive/
만든이 링크: http://www.schloebe.de/wordpress/simple-yearly-archive-plugin/

선택한 이유

  • 리스트에 Private Post도 보임 (로긴후)
  • Comment 숫자 표시 여부 설정 가능
  • 날짜표시 여부와 형식 설정이 가능함

설정 방법

플러긴 활성화 시키는 건 생략.

아래와 같은 코드를 원하는 page의 원하는 위치에 넣는다.

1
<?php simpleYearlyArchive('타입','제외할카테고리ID들'); ?>

page나 post에 간단하게 불러오려면 이렇게 해도 된단다.

?View Code HTML4STRICT
1
<!--simple-yearly-archive-->

설정 파라미터

타입(type)

  • yearly: 연도 기반의 리스트를 보여준다 (기본).
  • yearly_act: 올해의 포스트 리스트만 보여준다.
  • yearly_past: 지난해 까지의 포스트 리스트를 보여준다.
  • “date of year”: 연도를 숫자로 기입하면 해당 연도 1년치를 보여준다.

제외할카테고리ID들(ExcludeCategoryIDs)

  • 제외할 카테고리 ID를 콤마(,)로 구분하여 기입한다.

설정 예

1
2
3
4
5
<?php simpleYearlyArchive(); ?>
<?php simpleYearlyArchive('','1'); ?>
<?php simpleYearlyArchive('yearly','4,7,9'); ?>
<?php simpleYearlyArchive('yearly_act',''); ?>
<?php simpleYearlyArchive('yearly_past','1,2'); ?>

이 플러긴이 활성화되어 있지 않은 상태로 위 코드가 들어가 있으면 theme이 깨질 수 있다. 그런 것을 방지하기 위해선 아래와 같이 적어도 된다.

1
2
3
4
5
<?php
if (function_exists('simpleYearlyArchive')) {
   simpleYearlyArchive('yearly','4,7,9');
}
?>

Leave a Reply

Type this numbers Enter this code

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>