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

get_post_custom: get image URL instead of image ID

If its your own custom post type you should know the field names? Iterate through the fields – or better just get the required field – an then use the attachment Id with wp_get_attachment_image_src.

http://codex.wordpress.org/Function_Reference/wp_get_attachment_image_src

Chech the codex for further examples and Google for “WordPress custom post type fields”.

Related Posts:

  1. How do I get the avatar URL instead of an HTML IMG tag when using get_avatar?
  2. Programmatically get images by URL and save in uploads folder
  3. Function to get URL of original uploaded image – full size
  4. How to reference a theme image in a stylesheet?
  5. Mixed content warnings after changing site adress from HTTP to HTTPS
  6. Preview Image Path in Admin Section
  7. Why would image paths in wordpress suddenly change?
  8. Remove the http protocol from images
  9. How do i reference the theme path in pages for images?
  10. Regenerate missing _wp_attachment_metadata
  11. @wordpress/create-block image url in css
  12. WordPress url image redirect to the homepage
  13. Broken urls with http site and https wp-admin
  14. A way to change image urls in post to cdn image url?
  15. How to change image url?
  16. Update image links in database
  17. Shortcode for a link and thumbnail
  18. Retrieving an alt tag from a custom field
  19. media_sideload_image with rewritten urls?
  20. Get thumbnail url of custom meta image?
  21. Dynamic tagged image galleries
  22. How to add an image to a custom url?
  23. images not showing after transfer
  24. Change media URL (images)
  25. Generate images to be associated for tag and category?
  26. Display an icon with get_post_meta?
  27. How to redirect homepage to actual URL?
  28. Clicks registering on Preview DNS site
  29. Remove “%” from strings in serialized arrays in wp_postmeta
  30. Is it possible to enable the ‘Link To’ field under ‘Attachment Display Settings’ for a Featured Image?
  31. Using a .pdf file as a page in wordpress
  32. How to get image URL from media_sideload_image?
  33. Exclude image url from search query
  34. Redirect Image Url to a page via htaccess
  35. How to pass on a value as parameter via url to another page
  36. Image not showing using a custom function and get_post_meta
  37. How to replace post image url before posting using api?
  38. How to join Caption AND Description Meta Fields as one combined-caption in Image Block
  39. Hide or mask the url to an image
  40. Glitched page redirects to image
  41. i want to change URL of WordPress image or rewrite in runtime
  42. How to Display Image Caption but Not Alt Text
  43. Adding Facebook’s image and meta description retrieval capabilities to a WordPress post
  44. How to show a full page when someone links directly to an image on my site
  45. Bypass wp_safe_remote_get()?
  46. Which tools should I use for a gallery that uses an API and url for the path of the images?
  47. List sub pages with custom field content converting image ID to URL
  48. get_post_meta returning broken path in image src
  49. Adding Image Description below Images Inserted into Posts
  50. Change the image for a certain URL
  51. Setting name of attachment URL
  52. Search and replace image urls in posts
  53. Protocol relative url not pulling up images on IE, FF, and OPERA
  54. Broken image URL
  55. How do I mitigate the forward slash problem for URLs of images after a WP migration?
  56. Images in sub-pages fail to load
  57. Are image addresses security relevant?
  58. Remote Image (from URL) as Media Library element
  59. WPALLIMPORT Exporting images from repeater field [closed]
  60. All WordPress Website Images Broken
  61. 409 error (Conflict) when trying to insert an image into a post
  62. Exclude image titles from search results
  63. Does WP create multiple images?
  64. Thumbnails generated by “add_image_size” are not removed when removing media
  65. WordPress 3.0 embedded images
  66. TImthumb not working for absolute path
  67. Correctly implementing the Facebook Like button
  68. Change image name during uploading sequentially
  69. Store in media library image uploaded from url
  70. Get images attached to a specific page
  71. add_image_size function not working
  72. image resizing on post content without css and html tags
  73. Stop WordPress compressing images? – Quality is terrible
  74. link featured image to external link
  75. Using mysql to replace img src?
  76. wordpress add image size crop function not working in version 3.8
  77. Cache issues with images not showing up
  78. Specific Days, Specific image on Front Page
  79. Doing a bulk replace of images through back-end
  80. Can I achieve this with WordPress?
  81. I would like to set a FULL SCREEN background image to all my pages (same way it is on my home page)
  82. How to change a theme’s footer image
  83. Can’t upload Images to WordPress – Error 500 Response
  84. Enlarge Featured WordPress Images
  85. WordPress 4.4.2 upload give error, can’t write is upper directory allowed to be written
  86. How to attach 1000’s of unattached images
  87. Images are not getting uploaded
  88. Unable to delete images in Media Library
  89. click on Gallery picture but pictures doesn’t appear
  90. set specific dimension or minimum upload size [duplicate]
  91. Assigning image to Post-Type won’t work anymore: exceeded time?
  92. How to add a meta information to the URL?
  93. Content around featured image
  94. Getting featured image of blog page rather than post image
  95. Add custom version to an image
  96. get_theme_file_uri function not showing background image inside data-setbg in html
  97. Media Library shows default image instead of image preview
  98. Uploading media to wordpress API with C# HttpClient
  99. How to add image alt attribute to the thumbnail code
  100. Critical error on image display
Categories images Tags images, post-meta, urls
404 not found problem with URL rewrite custom category
Get custom taxonomy term url on archive 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