WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

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

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

share|improve this answer

Your Answer


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.