Checking if an image exists within WP?
-
Hi,
I’m trying to get a rotating sidebar background image. I’m trying to find a way to see if an image file exists through a relative path. Using an absolute path, this works:
if( fopen(“https://etc”, “r”) ){
echo foo;
}But I can’t seem to find a way to make it work with a relative path. Reason is that it really slows down pageload time for it to check the url as an “outside” url (https://www.etc…).
Help?
Thanks
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- The topic ‘Checking if an image exists within WP?’ is closed to new replies.