문제

I have a folder inside my theme where I hold some txt files which I am including in a theme. The problem is that before including txt file I need to check if it does exist. I fail checking it the following way and have no idea why it wont work, always returns false.

$themeLocation = get_bloginfo('template_url');
$fileName1 = $themeLocation.'/txtfolder/file1.txt';

if(is_file($fileName1)){
   echo 'It does exist';
} else {
   echo 'Error';
}

올바른 솔루션이 없습니다

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 wordpress.stackexchange
scroll top