Something like this?
$image_alt = get_post_meta( $image->id, '_wp_attachment_image_alt', true);
To use in your string:
if ($image) echo '<img src="' . esc_url($image) .'" alt=".$image_alt.">woocommerce-CJD">';
Use it under the $image declaration. In your $image declaration make sure youll get the image attachment via wp_get_attachment_image() function.
Related Posts:
- How do I delete all UNUSED images from my uploads directory?
- Did I do it right? Deleting images after deleting product. Woocommerce
- Woocommerce featured image of page – not product
- wordpress (woocommerce) add image to media library programmatically python
- Resize into square the single product image in woocommerce without cropping [closed]
- How to make footer area transparent? Using Avada and WordPress [closed]
- Product Images Low Quality After Updating From WP 3.5 to 4 [closed]
- Hide image gallery in Woocommerce if NO image [closed]
- When upload a PNG a noise appears in the thumbnails
- Exclude first image from a Woocommerce image gallery
- Why does wp_get_attachment_image_src return the wrong size, when the correct size exists?
- How to delete images from database with product
- WooCommerce Variation Swatches and Photos – get attribute thumbnail
- Bypass wp_safe_remote_get()?
- Image thumbnail on single product issue | WooCommerce
- Thumb doubles the image file size
- How to change image type for specific size?
- Maintaining image color and quality when uploading using custom sizes
- add_image_size() zoom-crop
- Upload Image Not accessible
- Which are precisely the predefined image sizes?
- Caption in Page adding unwanted 10px to width
- Adjust image caption within visal editor
- Change Image URL to a CDN
- How to add a media with PHP
- Responsive Images – Add srcset attributes to custom Images Function
- Getting custom size image URL
- Get original image from thumbnail URL
- Loss of sharpness in jpg imported as header in twentyeleven
- Getting alt text of featured image
- Can I the caption shortcode to set caption to a data attribute, and with the image’s alignment intact?
- How to resolve – IE 6 ignores img “width” properties
- WordPress is stripping the Alt tag’s quote marks from images where Alt is not set, but leaving the word ‘alt’ creating problems for ADA compliance
- WordPress reduces the full size image and uses it as the original
- get the image of the post
- Is There A Way Of Using the_post_thumbnail() to Pull In A Specific Image From The Media Library
- Update image links in database
- ACF Image ID, echo the alt tag
- Change WordPress Media Manager
- How to stop images from being wrapped in tags?
- Pull Random Attachments With Pagination
- Upload media files to Amazon S3
- Out of memory error reporting
- How do I create an alternate RSS feed for tags with custom image sizes for MailChimp?
- How to get default image sizes attribute
- Remove the inline styling added in wp_get_attachment_image()
- Image not shown in the theme as it’s showing in HTML template [closed]
- Broken image links even though links are correct and images exist
- Broken Images until Page Refresh
- How to add an image to a custom url?
- Get image from parent category
- Images attached to posts from library link to 404 error page
- Images not displayed when moving site to local
- Caption and title in img alt tag are the same?
- fetch images and videos
- Specific image size is being generated without being registered
- How to use Facebox in WordPress theme?
- How to display title of attached image in post?
- Getting thumbnail of uploaded image
- Display image for first sticky post only
- Get all image IDs from the Media Library
- Allow users to contribute images to a post
- Can’t add image to site via php
- Is it possible to enable the ‘Link To’ field under ‘Attachment Display Settings’ for a Featured Image?
- Save Image in wp_options-Table
- Can I register a new thumbnail size and have it be an option in “Add Media”?
- Image upload error?
- Is it possible to get feature image url (full-size) from an image url of smaller size?
- How to make Custom Loop not crop featured images?
- Image not showing using a custom function and get_post_meta
- Random home page background images with caption text
- How to add “alt” attribute for image during upload at WP front-end?
- Get Original Dimension Featured Image on the homepage
- WordPress keeps resizing my 947×947 image down to 500×500 (full-size option)
- Excluding post thumbnail from the attachment.php when using wordpress gallery
- Featured Image Thumbnail size on Twenty Ten Archive Page
- attach several images to post + gallery
- How to change background slider image when hovering on text?
- Widget Style – Icon Type
- WordPress Problems
- WordPress PHP custom function is causing 500 Internal Server Error Connection Timeout
- Get post thumbnail in specific size
- How to trigger “wp_handle_upload_prefilter” filter when uploading an image programatically?
- How to add element to the list of adjacent images?
- Text not wrapping properly around image in WordPress Visual Editor [closed]
- Why do images inserted in the post content via the_content() go off the max-width?
- Theme page headers and rotator images not assigned after website migration
- WPML – Change media uploader language
- How can I hook and edit on the fly an image uploaded
- Anomaly with response coming from XML RPC Api get Post (integer out of range)
- Create a custom attachment thumbnail for quick page load
- Change the image for a certain URL
- Multiple gallery thumnbnails on one page
- Change image link in excerpt to point to post
- Putting the title attribute in image tag — Snapshot Theme from Woothemes
- Post migration – images do not display
- wp_handle_upload Image sizes
- Display Images from Array with wp_get_attachment_image() [closed]
- How to import external media items into wordpress media library (without using storage)
- WordPress Site Broken and it gives Headers Already sent error