0

I have a product image catalogue and i'd like to display the Uploaded date of the image:

I can see on the media library it displays on-top of the item: Uploaded on: April 15, 2021 as an exmaple but how do I access that? in my templated files

1 Answer 1

0

If you have the attachment ID, you can just use get_the_date():

<?php echo get_the_date( '', $attachment_id ); ?>

If you leave the first argument blank, e.g. '', then it will use the date format from settings. If you don't want that, then provide a PHP date format.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.