Shortcode for Custom Field of Media Attachment (to use with Featured Images)

The most basic option I can think of is this add_shortcode(‘bt_featured_image_acf_location’, ‘bt_featured_image_acf_location’); function bt_featured_image_acf_location ($atts) { return get_field(‘location’, get_post_thumbnail_id()); } Change ‘location’ to your acf field name and thats it. get_post_thumbnail_id() will get the current post featured image id. Once you have the ID of the post (images are posts, they are of the post … Read more

How to display the Media Library Items Upload date

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.

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)