0

I'd like to retrieve a list of all attachment URLs for all posts of a website.

This would bring something like
http://example.com/mypost/attachment-1/
http://example.com/mypost/attachment-2/
http://example.com/anotherpost/attachment-deff/
http://example.com/post3/attachment-deff4/

Would it imply to use: wp_get_attachment_url

2
  • 1
    Every attachment has its own page. You can retrieve that page url using get_permalink($attachment_id);
    – Abhik
    May 5, 2022 at 17:46
  • You mean you want to get it from the builtin sitemap xml?
    – birgire
    May 5, 2022 at 19:10

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Browse other questions tagged or ask your own question.