Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I have some folder with images in /wp-content/uploads. I also have a plugin file in /wp-content/plugins. I want to retrieve the images stored in /wp-content/uploads and use them in the plugin file.

I have tried

echo'<img src="../../USER_PHOTOS/ronny'" href="#"></img>';

can someone show me how I can get the path to these images? thanks.

share|improve this question
add comment

2 Answers 2

If I'm not mistaken, you may want to try the wp_uploads_dir function, like so:

$uploads = wp_upload_dir(); 

echo '<img src="' . esc_url( $uploads['baseurl'] . '/USER_PHOTOS/ronny/' ) . '" href="#">';
share|improve this answer
add comment

I found the answer. I used wp_upload_dir(); wordpress codex

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.