Codex

Interested in functions, hooks, classes, or methods? Check out the new WordPress Code Reference!

ko:get stylesheet directory uri

설명

현재 사용중인 테마 혹은 차일드 테마의 stylesheet 디렉토리 URI 를 반환합니다. SSL 사용 여부를 체크합니다.

Note: 맨 끝에 슬래쉬를 포함하지 않습니다.

완성된 전체 URI를 반환합니다. 즉 웹 주소 (http:// 혹은 https:// (SSL을 사용하는 경우) 로 시작하는) 를 반환합니다. 이 함수를 사용하는 가장 적절한 예는 링크를 걸거나, 스타일 시트를 참조하거나, 이미지를 추가할때 입니다.

차일드 테마를 사용하고 있을 경우, 이 함수는 차일드 테마 디렉토리의 URI 를 반환합니다. 만약 차일드 테마에서 부모 테마의 URI 를 호출하고 싶다면 get_template_directory_uri() 함수를 사용하세요.

또한 로컬 PHP 파일을 참조(include)하고 싶은 경우, get_stylesheet_directory() 함수를 사용하세요.

사용법

URI 사용 <?php get_stylesheet_directory_uri(); ?> URI 를 출력 <?php echo get_stylesheet_directory_uri(); ?>

Parameters

없음.

Return Values

uri (string) 
Stylesheet가 있는 디렉토리(테마 폴더)의 URI.

예제

이미지 (HTML)추가시

<img src="<?php echo get_stylesheet_directory_uri(); ?>/images/aternus.png" alt="" width="" height="" />

js 파일 참조시

wp_enqueue_script( 'child-common', get_stylesheet_directory_uri() . '/asset/js/child-common.js', array( 'jquery' ));

Notes

Change Log

Source File

get_stylesheet_directory_uri() is located in wp-includes/theme.php.

Related


Theme paths: get_template(), get_template_directory(), get_template_directory_uri(), get_theme_roots(), get_theme_root(), get_theme_root_uri(), get_stylesheet(), get_stylesheet_uri(), get_stylesheet_directory(), get_stylesheet_directory_uri(), get_bloginfo(), get_theme_file_uri(), get_theme_file_path()

See also index of Function Reference and index of Template Tags.