2016-06-04 1 views
1

다음 디렉토리 구조를 가진 wp 사이트가 있습니다. 디렉토리 구조는 :WordPress : 부모 테마에 포함 된 PHP 파일을 어떻게 덮어 쓸 수 있습니까?

themes 
|-parent-theme 
| |-index.php 
| |-some-footer.php 
| 
|-parent-theme-child 
    |-some-footer.php 

부모 - 테마 디렉토리는 PHP 파일의 무리를 포함하고 index.php에 그들 중 하나입니다.
index.php 파일은 some-footer.php를 사용 (포함)합니다.

<?php include('some_footer.php'); ?> 

정확한 이름을 가진 파일을 만들어이 some-footer.php를 덮어 쓰려고하는데 작동하지 않습니다.

이 작업을하려면 어떻게해야합니까?

답변

1

가 아이 테마에 있기 때문에,

<?php include(get_stylesheet_directory_uri() . '/some_footer.php'); ?> 
+0

get_stylesheet_directory_uri();은 PHP는 ('some_footer.php')을 포함하면 줄을 <대체 뜻 사용해보십시오; ?> 당신이 제안한 것과? –

+0

예, 시도해보고 작동하는지 확인하십시오. – kcbluewave890

관련 문제