problems with alt text not appearing in source code

The display/use of various <img> attributes is up to the theme code. If the theme code does not use the info from the media item, then it will not display. Fixing this will require digging into the theme code to figure out where the <img> code is generated, and then modifying that code. Note that … Read more

WordPress can’t get image url but both the attachment and the actual file are there

Not sure how you’re using it, but wp_get_attachment_image_src() returns an array. This should work: <?php $attachmentID = 519271; $imageSizeName = “thumbnail”; $img = wp_get_attachment_image_src($attachmentID, $imageSizeName); ?> <img src=”<?php echo $img[0]; ?>” alt=”image”> An alternative to try if it isn’t working: <img src=”<?php echo wp_get_attachment_url(519271); ?>” alt=”image”> This thread discusses your issue further: wp_get_attachment_image_src always returns … Read more

Get content from one WordPress website to another

If you have access to the old WordPress site go into the admin section then > Tools > Export. Where it says Choose what to export check All content, and click Download Export file. In the new WordPress site go into the admin section > Tools > Import > choose WordPress form the list (it … Read more

How to show file type of featured image?

If you want to show the File type of featured image. then try the below code. <?php $id1 = get_post_thumbnail_id($post->ID); $type = get_post_mime_type( $id1 ); $mime_type = explode(“https://wordpress.stackexchange.com/”, $type); $type=”.”.$mime_type[‘1’]; echo $type; ?> It will display the exact extension that you want “.jpeg” from “image/jpeg” Here “$post->ID” is current post id (or the id of … Read more

How to get the attribues (alt and title) of an image import with ACF [closed]

It’s already in the docs. Try this: <?php $image = get_field(‘image’); if( !empty($image) ): ?> <img src=”https://wordpress.stackexchange.com/questions/223867/<?php echo $image[“url’]; ?>” alt=”https://wordpress.stackexchange.com/questions/223867/<?php echo $image[“alt’]; ?>” /> <?php endif; ?> For easier debugging, try this: var_dump($image); to print out the $image variable to know what is in $image. You can also put var_dump($image) inside <pre> tag for … Read more

How to show file size of featured image? [duplicate]

Following function calculate file size, just you need change ‘/myfile/image.jpg’ with your featured image variable. <?php function file_size($url){ $size = filesize($url); if($size >= 1073741824){ $fileSize = round($size/1024/1024/1024,1) . ‘GB’; }elseif($size >= 1048576){ $fileSize = round($size/1024/1024,1) . ‘MB’; }elseif($size >= 1024){ $fileSize = round($size/1024,1) . ‘KB’; }else{ $fileSize = $size . ‘ bytes’; } return $fileSize; … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)