home.php | 최신 게시물 페이지

|

개요

기본페이지 is_home() 조건에 사용되는 템플릿입니다.

코드

<?php get_header ?>

if ( is_home() ) {
    // This is the blog posts index
    get_sidebar( 'blog' );
} else {
    // This is not the blog posts index
    get_sidebar();
}

<?php get_footer ?>

is_home() : 현재 페이지가 홈페이지인지 체크합니다.

get_sidebar( 'blog' ) 는 활성화된 테마 폴더에 있는 sidebar-blog.php 를 불러들입니다.

get_sidebar() 는 활성화된 테마 폴더에 있는 sidebar.php 를 불러들입니다

참조

답글 남기기

이메일 주소는 공개되지 않습니다. 필수 필드는 *로 표시됩니다

클릭하여 복사