i added some image to my wordpress library. now i need to retrieve one of them by name and get it’s URL. note that i didn’t attach them in any post.
thanks for your attention.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
A straightforward approach – using a direct SQL
SELECTstatement with the WordPress database abstraction API:You can incorporate this into a function (you can place in your functions.php file):
And the in your templates you can call you functions like so: