If file exists code issue.
-
Been trying to get this little piece of code to work and cant seem to get it right, the part im trying to get working is the
Pretty much just trying to write out if a file exists. so in the example below im expecting /wp-content/uploads/categories/art.jpg<?php $category = in_category() ; $filename = (getcwd(). '/wp-content/uploads/categories/') . $category ; if (file_exists($filename)) { echo "The file $filename exists $category"; } else { echo "The file $filename does not exist: $category"; } ?>
[Please post code or markup snippets between backticks or use the code button.]
thanks in advance.
- The topic ‘If file exists code issue.’ is closed to new replies.