Skip to content
Read For Learn
Read For Learn
  • Database
    • Oracle
    • SQL
  • C
  • C++
  • Java
  • Java Script
  • jQuery
  • PHP
Read For Learn
  • Database
    • Oracle
    • SQL
  • C
  • C++
  • Java
  • Java Script
  • jQuery
  • PHP

Retrieving an alt tag from a custom field

The following ought to be much closer to what you want to achieve:

<div class="imgHentry">
    <a href="https://wordpress.stackexchange.com/questions/74228/<?php the_permalink(); ?>" class="goto-icon">
        <?php the_post_thumbnail(
            'thumbnail',
            array( 'alt' => get_post_meta( $post->ID, 'alt_tag', true ) )
       ); ?>
    </a>
</div>

Related Posts:

  1. Regenerate missing _wp_attachment_metadata
  2. Get thumbnail url of custom meta image?
  3. Dynamic tagged image galleries
  4. Generate images to be associated for tag and category?
  5. Display an icon with get_post_meta?
  6. Remove “%” from strings in serialized arrays in wp_postmeta
  7. Image not showing using a custom function and get_post_meta
  8. How to join Caption AND Description Meta Fields as one combined-caption in Image Block
  9. How to Display Image Caption but Not Alt Text
  10. get_post_meta returning broken path in image src
  11. Adding Image Description below Images Inserted into Posts
  12. get_post_custom: get image URL instead of image ID
  13. Each custom image size in custom upload directory?
  14. How to automatically add rounded corners to thumbnails?
  15. Get attachment/image info in JS
  16. Auto-modifying original [full size] images
  17. show author image in posts
  18. How to limit number of images being printer out in “Set Featured Image” pop up?
  19. Replace Woocommerce Images
  20. Crop image to horizontal or vertical by code based on image size
  21. Pasting images removes class attribute
  22. How can I make all gallery images to open in a new window?
  23. Open the attachment details modal
  24. Crop image without scaling or resizing with add_image_size()
  25. copy attachments to another post type and change attachment url
  26. Can’t access ‘Store uploads in this folder’
  27. Is there a way to pull the first featured image in a loop and not all other featured images?
  28. How to Display Featured Image Title and ALT Attribute
  29. Is it possible to recover featured images after WordPress export/import
  30. how to stop generating different image sizes from parser
  31. Change the URL of an image from wp_get_attachment_image_src
  32. Do I need to resize an image to fit the post?
  33. Add Small Image Size to Media Settings
  34. Different image sizes for home and post pages
  35. Show full image thumbnail
  36. Make medium_large images available to insert into post
  37. alt tags of the images are not saving/emtpy
  38. Removing height and width from images with a caption
  39. Extracting gallery images in WordPress 3.5 on index.php
  40. Images not showing on blog
  41. Why does Google Image Search still display my images?
  42. Image auto resize
  43. Retrieve images from parent site to child site using current shortcodes
  44. WP fails to upload files to media library, /wp-admin/async-upload.php 403 forbidden
  45. Add a background image for Custom Post Type archives page
  46. Images stopped loadding after adding SSl
  47. Background-image not showing? [closed]
  48. GoDaddy Number of Image Files Per Directory Exceeded
  49. Post and featured image have the same name, why is the attachment (image) is showing and not the post?
  50. Scaling an image in a WordPress post
  51. Setup Featured image on all posts from thesis thesis_post_image custom field?
  52. Alter image meta fields in the Media Library
  53. Moving media library to the media library of completely different site
  54. convert post title to image
  55. Can you check if a post WYSIWYG field has an image in it?
  56. how to put image and text on same line [closed]
  57. Different background images on different sites [closed]
  58. Upload media only to DB
  59. Google Page Speed Insights – Optimize Images
  60. Weird failing request
  61. Is there a way in WordPress to convert images to WebP without a plugin?
  62. Partial img lazy load with WP 5.5
  63. Can’t see images in posts after migrating site to subdomain
  64. How to setting up the custom size thumbnail for wp_get_attachment_thumb_url()?
  65. Images dont show up on an iPhone [closed]
  66. Moving an image to the side [closed]
  67. How can i identify media uploaded to my website that is not being used anywhere anymore?
  68. Placing a featured image into header
  69. Function to grab specific image IDs from media library.
  70. image URL changed in wordpress
  71. Maximum image width/height?
  72. How can we upload common images only to AWS S3 using WordPress?
  73. Shortcode not work in picture source srcset tag
  74. wpdb function for filtering the images by title
  75. How to echo images Urls from a wordpress post, that are relally in the post
  76. Adding Post Thumbnail to Metro Pro Theme
  77. media_handle_upload() with 1 image under 1Mb chokes my server and returns timeout error
  78. WordPress does not load most theme images
  79. Updated wordpress missing image upload area
  80. convert images and media url into blob url
  81. get_post_gallery with Gutenberg
  82. How to find the largest images in wordpress post
  83. New portfolio items appearing smaller on the grid
  84. Image automatically resized
  85. WAMP install acts different than live install when uploading images
  86. Images Wont Display After Importing From Old WordPress
  87. Image thumbnail on single product issue | WooCommerce
  88. How can I hook and edit on the fly an image uploaded
  89. Anomaly with response coming from XML RPC Api get Post (integer out of range)
  90. Make all images displayed in single.php a certain size
  91. wp_get_attachment_image_src
  92. I am trying to get metabox image with custom size
  93. Removing image dimensions from `the_content`
  94. Is there a different way to grab a thumbnail image than this?
  95. Multiple gallery thumnbnails on one page
  96. Change image link in excerpt to point to post
  97. Putting the title attribute in image tag — Snapshot Theme from Woothemes
  98. Post migration – images do not display
  99. Change the avatar ratio?
  100. wp_handle_upload Image sizes
Categories images Tags images, post-meta
Auto resize images after adding a new size
Get Admin Email Address From External PHP page

Recommended Hostings

Cloudways: Realize Your Website's Potential With Flexible & Affordable Hosting. 24/7/365 Support, Managed Security, Automated Backups, and 24/7 Real-time Monitoring.

FastComet: Fast SSD Hosting, Free Migration, Hack-Free Security, 24/7 Super Fast Support, 45 Day Money Back Guarantee.

Recent Added Topics

  • Bug in translation system: load_theme_textdomain() returns true, files are available and accessible but the language defaults to english
  • Custom Elementor controls not appearing in the widget Advanced tab using injection hooks
  • Get the name of the template/*html file used
  • Trying to Add Paging to Single Post Page
  • Sharing media files between live and staging servers
  • How to display the description of a custom post type in the dashboard?
  • Critical error on image display
  • Copying WP data and files into new install?
  • How to determine the DirectAdmin WordPress backup date?
  • How to get list of ALL tables in the database?
© 2026 Read For Learn
  • Database
    • Oracle
    • SQL
  • algorithm
  • asp.net
  • assembly
  • binary
  • c#
  • Git
  • hex
  • HTML
  • iOS
  • language angnostic
  • math
  • matlab
  • Tips & Trick
  • Tools
  • windows
  • C
  • C++
  • Java
  • javascript
  • Python
  • R
  • Java Script
  • jQuery
  • PHP
  • WordPress