답변:
를 살펴보면 로드 될 template-loader.php조건을 확인할 수 있습니다 paged.php.
if ( defined('WP_USE_THEMES') && WP_USE_THEMES ) :
$template = false;
if ( is_404() && $template = get_404_template() ) :
elseif ( is_search() && $template = get_search_template() ) :
elseif ( is_tax() && $template = get_taxonomy_template() ) :
elseif ( is_front_page() && $template = get_front_page_template() ) :
elseif ( is_home() && $template = get_home_template() ) :
elseif ( is_attachment() && $template = get_attachment_template() ) :
remove_filter('the_content', 'prepend_attachment');
elseif ( is_single() && $template = get_single_template() ) :
elseif ( is_page() && $template = get_page_template() ) :
elseif ( is_category() && $template = get_category_template() ) :
elseif ( is_tag() && $template = get_tag_template() ) :
elseif ( is_author() && $template = get_author_template() ) :
elseif ( is_date() && $template = get_date_template() ) :
elseif ( is_archive() && $template = get_archive_template() ) :
elseif ( is_comments_popup() && $template = get_comments_popup_template() ) :
elseif ( is_paged() && $template = get_paged_template() ) :
else :
$template = get_index_template();
endif;
if ( $template = apply_filters( 'template_include', $template ) )
include( $template );
return;
endif;
마지막 elseif은 페이징 된 템플릿이있는 경우로드 된 위치입니다.
elseif ( is_paged() && $template = get_paged_template() ) :
즉, 위의 모든 검사에서 paged.php템플릿을로드하고 쿼리를 수행 is_paged하고 다른 컨텐트 관련 템플릿을 찾지 못하면 false를 반환해야합니다 .
is_paged()그러나 다른 특정 템플릿을 사용할 수있는 경우 해당 템플릿이 전에 호출 paged.php됩니다. 예를 들어 테마에 archive.php템플릿 이있는 경우 페이지 번호에 관계없이를 paged.php사용하는 모든 유형의 콘텐츠에 사용되지 않습니다 archive.php.
예, paged.php테마에있는 경우 해당 템플릿은 아카이브의 첫 페이지를 제외한 모든 페이지에 사용됩니다. 이는 아카이브의 스타일 / 마크 업이 첫 페이지와 후속 페이지간에 크게 다른 경우입니다.
archive.php거나 category.php, 존재 paged.php사용되지 않습니다. index.php템플릿 만있는 경우에만 paged.php우선합니다.
WP 4.7부터 paged.php가 템플릿 로더에서 완전히 제거되어 템플릿 계층 구조가 제거되었습니다.