I am not so sure of what I am going to say, but from a fast look, $featured_image is an array (URL, width, height, is_intermediate). so assuming that your alternative text exists in this array, you need to specify its index like this:
$featured_image[index_of_alt_text]
according to my understanding, the $featured_image array doesn’t contain your alternative text or you didn’t specify the index.
I hope it helped
Related Posts:
- How to loop through all the attached images in a post, and get their url one by one
- Only show first image in foreach loop
- what’s the syntax for if the image exists get the image?
- Retrieving specific images from Media Library
- Show css depending on activity type in BuddyPress activity-loop [closed]
- How to control WordPress image metadata (using Imagick)?
- Why my filterable portfolio page work not perfectly between slug button and slug output WORDRPESS?
- Get the post ID and display the images
- Responsive Header for Phone
- Reprinting tags with all attributes
- Iterate through posts based on array of categories
- get author_name from queried post
- Displaying Woocommerce Product Category in WordPress
- How to get next image with this code from same post?
- Unread Repeater field IMG alt not working
- How can I add extra word in permalink when someone click download button?
- Can’t upload image using media_sideload_image
- Increase offset while looping
- Blog posts repeat
- Upload multiple images to a Woocomerce product
- How to use thumbnail size of image if I’m only using src to get image
- How to add condition in wordpress loop? [closed]
- Woocommerce : Can’t get product info in loop
- How to set variable, pass it to a partial file and remove it after?
- how to refresh div on template part?
- What is the alternative to “ when it comes to calling Media (image) files in the ‘attachment.php’ file?
- Accessing an image folder inside public web directory
- get_children displaying images removed from the page
- Why is image hard cropping for one image using add_image_size not working?
- Enable custom logo upload if logo is not in header
- Alert Bar section within WP loop is displaying even though there are no posts
- Why my image upload button is not working in wordpress widget area?
- remove post that has no content
- Display category name only once inside loop
- Can’t find infinite loop cause
- Checking array against author id in loop
- How do I Turn This Into An if statement?
- Scrape external webpage for first image and add it to new post
- How to make own crop image function for WordPress plugin
- “imagejpeg” function is not working in wordpress
- Display image from an external rss feed on wordpress without plugins
- Load wordpress content in other domain
- How Can I use WP_Query to Only Display 1 Post from Custom Post Type if Query Returns Posts with Matching ID in Custom Field
- Checkbox doesn’t stay checked, conten
- WordPress automatically adds links to uploaded images
- post thumbnail, conditions, else wont work
- Widgets in the loop if active
- WordPress function when file is uploaded, deleted or edited
- List posts that don’t have a specific tag?
- Changing the_posts_navigation() html output
- Can we count the WordPress Loop
- Get post id within comments loop
- Syntax error when I try to insert my loop into an unordered list? [closed]
- WP_Query fails despite having 1 post
- Download images from media library to computer in BULK?
- Three Questions with Twenty Eleven theme
- Add content after the first post in WP Loop
- wp_query get the 2nd post
- Loop stopped working
- How to get post ID in a Page?
- Custom Pagination is Broken
- Display an image if odd number of posts in grid
- I’m trying to create an array with a foreach loop, but the array only stores the last item [closed]
- PHP Warning: strip_tags() expects parameter 1 to be string?
- Which function crops images in wordpress?
- Division by zero error in image.php
- Store post content in a php variable and output them using for loop
- Resize image to specific dimension (X to Y ratio)
- How to add div blocks after certain set of post
- Echo a shortcode div after every 3 posts
- How to avoid duplicates when creating recent network posts
- How can I automatically resize up images to fit into all of my registered image sizes
- How to overwrite orderby with add_query_var
- What file have I to create in my custom WordPress theme to show all the post belonging to a specific category?
- Why in my theme I can’t see all the statics content under the posts?
- 2nd page displaying the exact same posts as my first page (minus the very first post)
- Clickable image link sends people to wrong URL
- Is the 404 page automatically displayed if a loop returns nothing?
- How do I remove a category from a wordpress loop>
- Only show image from custom field when present
- variable value disappears in a second loop
- Last class on last headline?
- Show recent posts starting at a specific number archive
- Timthumb.php image gallery not working on Multisite WordPress
- Upload non-featured image to image field
- get_the_ID() in the footer returns wrong value
- How to get the last category name of a child category?
- Show ACF field with link to ultimate member profile/WordPress user profile below the post (single post layout)
- WordPress query undefined offset in loop
- Where are the src and srcset sizes coming from?
- How to pass a variable to get_template_part that’s updated every time the template part is called?
- HTML showing after PHP code in tag
- How to unlink all posts from tracking same amount of views
- Issue with custom loop in Archive page
- Why my loop isn’t working? [closed]
- WordPress loop by meta key that is an array? and how loop multiple arrays
- trying to get wp_get_attachment_url to output clickable link
- use loop to return blog details
- Change default gallery images – Currently they are displaying full size imagese
- How to get current post category details inside “loop”?