Cannot display or echo alt text on featured image

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 … Read more

unattached media files that should be attached

It’s not a problem with WordPress. It’s how it should be. If you see the image below of media library. You can see that the column name is Uploaded to which means that media file was not there before and it’s introduced or uploaded to the below mentioned post/page/etc. Since in your case it’s uploaded … Read more

Get image’s size name from it’s dimension

Here I’ve written a function for you. Place this below function on your functions.php or any where that executes and pass the width and height value to it. It will return you the image size name as string and if it has not found any then it will return false. /** * Get name by … Read more

Where are the resized images coming from?

These various resized images come from registered image sizes, usually from your theme, and sometimes from plugins. If a theme registers an image size, it expects to use that size in the front-end. This is most useful in an image gallery or slideshow, when you need images to be an exact ratio of width to … Read more

Add custom url to featured image

you can do this pretty simply. I’m guessing you are inside the wordpress loop. Basically, get the link url, get the image url, echo out. <?php $custom_link = the_field(‘custom_url’); //probably want to check if this is empty $post_thumb = get_the_post_thumbnail( $post_id );//you can pass size if you would like echo ‘<a href=”‘ . $custom_link . … Read more