0
votes

I am building a custom wordpress theme and would like to offer my client the ability to upload the background image through the media manager in WP.

However, I can't sort out how to get to the image with my CSS. I thought it would be a simple matter of setting the url to the UPLOADS folder in wp-content.

But, the media manager does not dump all the images into one directory, it organizes them by month and year.

How can I determine the path to a specific image in the media library?

1
If you want you can disable the option to have them organized into the month and year folder by going to the Media settings. Otherwise you can probably get the id of the file and then use the wp_get_attachment_image_src function to get it path. - Virendra
Thanks. If you would like to post that as an answer, I will accept it. - Lee Loftiss

1 Answers

0
votes

If you want you can disable the option to have them organized into the month and year folder by going to the Media settings.

Otherwise, you can probably get the id of the file and then use the wp_get_attachment_image_src function to get it path. You can find more information about the function here