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. How can I get or the intermediate size of an image with wp_get_attachment_image_src without using post meta?
  62. show hide image script after 4 seconds [closed]
  63. Restricting users to view only media library items they have uploaded?
  64. How do I disable responsive images in WP 4.4?
  65. Filter to remove image dimension attributes?
  66. How to get a list of all the possible thumbnail sizes set within a theme
  67. Image Upload from URL
  68. Programmatically adding images to media library
  69. How do I delete all UNUSED images from my uploads directory?
  70. Set default image sizes in WordPress to hard crop
  71. Is it possible set a featured image with external image URL
  72. get attachment title based on attachment id
  73. Stop wordpress from hardcoding img width and height attributes
  74. Handle issues with change of image scaling (rounding) in 4.1 (WP Ticket #18532)
  75. Prevent WordPress from generating medium_large 768px size of image uploads?
  76. remove or update add_image_size
  77. Get Image Description
  78. How to extend the gallery block in Gutenberg?
  79. Image quality based on image size
  80. how to get original image using wp_get_attachment_image_src
  81. What is a good alternative to using $content_width for image optimization?
  82. get the attachement url for the medium sized image
  83. Can I attach image to post without adding it to post?
  84. Automatically replace original uploaded image with large image size
  85. WordPress crop tool greyed out
  86. How to scale up featured post thumbnail?
  87. Upload images to remote server
  88. Custom image size / thumbnail – Crop to aspect ratio even when source image is smaller than set dimensions
  89. Each custom image size in custom upload directory?
  90. Getting Images from theme’s directory in pages
  91. Set default image link target in Gutenberg image block
  92. Add an alignment option for images
  93. How to delete resized (cropped) image uploads and prevent future resizing?
  94. How to automatically add rounded corners to thumbnails?
  95. WordPress adding scaled images that don’t exist (1536×1536 and 2048×2048)
  96. Download an image from a webpage to the default uploads folder
  97. How to add category to: ‘wp-admin/post-new.php’?
  98. Add image size where largest possible proportional size is generated
  99. WP 4.4. responsive images browser choosing the “wrong” one
  100. After Moving a Site to Another Domain, All Images Are Lost
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
  • Post Navigation Elementor
  • Custom Elementor controls not appearing in the widget Advanced tab using injection hooks
  • WPFacet multiple loop displaying duplicate content
  • Get the name of the template/*html file used
  • Fix: WordPress.DB.PreparedSQL.NotPrepared Plugin Check (PCP)
  • Removing unnecessary CSS and JS code from wp_head()
  • hexagonal image gallery. Am I on the right track? [closed]
  • Trying to Add Paging to Single Post Page
  • Sharing media files between live and staging servers
© 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