Ok I found the answer that no one has on the net I been looking for days now.
Here is how I was able to do it. Hope this helps someone out there
// This is getting the image / url
$feature1 = get_theme_mod('feature_image_1');
// This is getting the post id
$feature1_id = attachment_url_to_postid($feature1);
// This is getting the alt text from the image that is set in the media area
$image1_alt = get_post_meta( $feature1_id, '_wp_attachment_image_alt', true );
Markup
<a href="https://wordpress.stackexchange.com/questions/221481/<?php echo $feature1_url; ?>"><img class="img-responsive center-block" src="<?php echo $feature1; ?>" alt="<?php echo $image1_alt; ?>"></a>
Related Posts:
- Theme Customiser Image Control
- SSL: How to make customizer images Protocol Relative in WordPress?
- Problem Cropping Images From WP Customizer
- wp_customize_image_control deprecated add_tab alternative
- Utilise WP_Customize_Image_Control to only show image picker
- 3.5.x Theme Customize: Handling Custom Control Requests
- Set image dimension for WP_Customize_Image_Control images
- How to return responsive images from a sanitize_callback?
- Customize all image captions
- Automatically replace original uploaded image with large image size
- How to scale up featured post thumbnail?
- Custom image size / thumbnail – Crop to aspect ratio even when source image is smaller than set dimensions
- wp_get_attachment_image_src and server path
- Change WordPress image URLs via filter
- How to resize images in wordpress without adding any compression or changing the color profile of the images, possible?
- hook into completed image upload filter
- Why is wp_get_attachment_image not including “full” size in srcset?
- How can I serve different images depending on screen size with wordpress
- Setting up a gallery with images and a zip download
- When inserting images into posts auto add a wrapping div
- Is it possible to prevent users from uploading small images?
- how to base64 encode images in wordpress template
- get_children – wp_get_attachment_image
- Generate fixed image sizes for different pages, eliminate sizes during upload
- How to add an image for unit testing?
- Setup A Default Featured Image
- Find posts without featured image? [duplicate]
- How do I add a featured image to a single post page?
- Custom image size not regenerating when image editted
- How can I autopopulate titles in the media library?
- Image still linked as attachment to page even though it has been deleted
- Disable wordpress image sizes generation
- Is 700,00 jpgs too many for a WordPress site.?
- Change the RSS feed image
- In media library images are not displaying run time [closed]
- Best option for photo/gallery handling?
- Frontend Post – Allow Only Image File Upload
- Plupload resize for worpdress
- File format of post image attachment
- Question about add_image_size()
- How to display a different image size for mobile
- Photography Based Design – Multiple Images Per Post
- SEO images in Nextgen Galleries
- Remove Size images without use
- Woocommerce featured image of page – not product
- Can’t seem to attach uploaded image to post and set it as thumbnail
- Add an attribute to attachments
- Include caption underneath post images
- Domain Change with New Image Sizes
- How to prevent WordPress scaling large images down
- wordpress (woocommerce) add image to media library programmatically python
- How to translate get_intermediate_image_sizes?
- Change media URL (images)
- Difficulties setting a maximum image width
- Does wp_get_attachment_image_src also work with non-image files?
- Why does WP allow to view and media item as a page
- Console Browser says it cannot find a requested image that does not exist on my Website [closed]
- Display attached images as background-image css
- Remove Additional image sizes created by theme
- Images don’t load erratically
- Show Image Size as Dragging it Larger or Smaller
- Logo on the tab
- How can I get url from image tag in feed with fetch_feed?
- How to get image name, mime type, width, height, file size from post custom field?
- How to automatically populate a gallery with images attached to posts of one category?
- How to edit caption for images and exclude it from excerption query?
- Can’t seem to see images on my machine but can on the server
- Add a span tag around image
- fitting the thumbnail image into a div
- Editing already up-loaded images
- Regenerate BIG threshold scaled images
- Change Image in Mobile Search Results
- WordPress Link To Image Missing Dropdown
- Is there a way to create referable automatic numbering in image captions?
- Issues Adding a jQuery Image Slider
- set_post_thumbnail_size only working for width
- Getting the closest named image size from an array of dimensions
- Newly uploaded images are not updating in featured image
- How to attach post ID to image links in WordPress tinymce editor
- How to stop a post from publishing if the file upload is not a image/gif
- Troubles with code for upload a image
- Duplicate images in wordpress
- Images not showing after moving site
- Some images don’t get linked when setting link-to to media-image
- Search and replace image urls in posts
- Thickbox not displaying just the image, instead showing full page in lightbox
- Post Images Size Change in WordPress
- Show uploaded images in full size
- trouble with featured image
- Have a rotating image covering body only on front page?
- Img src path from wp-admin
- get_post_custom: get image URL instead of image ID
- Featured Image not changing
- I moved WordPress to root now posts go to 404
- Can’t manage to display an uploaded picture (uploaded from a custom button) in the front end
- Script not working in WordPress [duplicate]
- Image Attachments Query Not Working If Post Is Loaded Via Ajax
- if user role is x – show image – wordpress
- Understanding images handeling
- Best practice for WordPress media image use