Template Tags/wp get archives
From 워드프레스(WORDPRESS) 한국어 위키
Contents |
[edit]
Description
이 함수를 이용해 날짜별 글 목록을 출력 할 수 있으며 방식은 get_archives() 와 동일하다. 두 함수의 차이점은 함수 설정값 입력 방식에 있다. 이 함수는 템플릿 파일의 어느 곳에서도 사용 될 수 있다.
[edit]
Usage
<?php wp_get_archives('arguments'); ?>
[edit]
Examples
[edit]
Last Twelve Months
최근 12개월 간의 목록을 월별로 표시 해 줌.
<p><?php wp_get_archives('type=monthly&limit=12'); ?></p>
[edit]
Last Fifteen Days
최근 15일 간의 목록을 일별로 표시 해 줌.
<p><?php wp_get_archives('type=daily&limit=15'); ?></p>
[edit]
Last Twenty Posts
최근 20개의 글 목록을 표시 해 줌.
<p><?php wp_get_archives('type=postbypost&limit=20&format=custom'); ?></p>
[edit]
Parameters
- type
- (문자) 출력할 목록의 타입을 결정. 올바른 입력값:
- monthly - 월별(기본값)
- daily - 일별
- weekly - 주별
- postbypost - 글별
- limit
- (숫자) 가져올 목록의 갯수. 기본값 : 전체.
- format
- (문자) 글 목록을 출력 할 포멧. 올바른 입력값:
- html - HTML 리스트 태그(<li>) 사용. (기본값)
- option - 선택상자(select 태그) 사용(<option>).
- link - 일반적인 링크 태그(<link>) 사용.
- custom - 사용자 지정.
- before
- (문자) format 값에 custom 또는 html을 사용했을 경우 링크 앞에 표시될 문구(혹은 태그) 지정. 기본값 없슴.
- after
- (문자) format 값에 custom 또는 html을 사용했을 경우 링크 뒤에 표시될 문구(혹은 태그) 지정. 기본값 없슴.
- show_post_count
- (0 또는 1) 해당 글의 갯수 표시 여부 결정. (1 - 표시), (0 - 표시안함). type 설정값이 'monthly' 일때 사용. 기본값은 0.
[edit]
Related
bloginfo, bloginfo_rss, get_bloginfo, get_bloginfo_rss, wp_title, get_archives, wp_get_archives, get_calendar, get_posts, wp_list_pages, wp_loginout, wp_register, query_posts, rss_enclosure

