워드프레스 커스텀 템플릿 로드 함수

해당 함수를 사용할 테마 경로에 커스텀 템플릿 파일 custom-script.php 생성.

e.g.
/wordpress/wp-content/themes/child
↓
custom-script.php
↓
템플릿 내용
<script defer src="<?php echo get_stylesheet_directory_uri(); ?>/script.js"></script>

호출할 템플릿 내에서 get_template_part('custom-script');로 해당 커스텀 템플릿명을 넣은 내장함수를 사용하면 템플릿의 내용이 그대로 출력된다, 끝.