함수를 입력하여 활성화된 테마에 있는 사이드바를 호출합니다. sidebar.php, sidebar-left.php 의 파일을 가져올 수 있습니다.
사이드바를 등록하는 방법도 있습니다. 이 경우는 사이
<?php get_sidebar();?>활성화된 테마폴더에 있는 sidebar.php 를 가져오는 방법입니다.
<?php get_sidebar('left'); ?>활성화된 테마 폴더에 있는 sidebar-left.php 파일을 가져옵니다.
<?php get_sidebar('left-top'); ?>활성화된 테마 폴더에 있는 sidebar-left-top.php 파일을 가져오는 방법입니다.
<?php
if ( is_home() ) :
get_sidebar( 'home' );
elseif ( is_404() ) :
get_sidebar( '404' );
else :
get_sidebar();
endif;
?>