0

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?

4

1 回答 1

0

如果您愿意,您可以通过转到媒体设置禁用将它们组织到月份和年份文件夹中的选项。

否则,您可能可以获取文件的 id,然后使用 wp_get_attachment_image_src 函数获取它的路径。您可以在此处找到有关该功能的更多信息

于 2013-09-02T21:35:35.287 回答