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

Mobile Featured Image Bug

The images not being loaded are prefixed with the domain https://i2.wp.com This is the CDN used when you activate the PHOTON module in the Jetpack Plugin. If you deactivate the PHOTON module or deactivate the Jetpack Plugin, you should be rid of the issue.

How to move image thumbnails into custom folder for custom post type

Use bellow filter in the functions.php <?php add_filter( ‘upload_dir’, function($args) { if( !isset($_REQUEST[‘post_id’]) ) { return $args; } $post_type_name = get_post_type( $_REQUEST[‘post_id’] ); if( $post_type_name=”custom_post_type” ) { // Set the new path depends on current post_type $newdir=”https://wordpress.stackexchange.com/” . $post_type_name; $args[‘path’] = str_replace( $args[‘subdir’], ”, $args[‘path’] ); //remove default subdir $args[‘url’] = str_replace( $args[‘subdir’], ”, $args[‘url’] … Read more

Watermark images only for some users

I figured out a sort of working solution, by using the plugin Image Watermark by dfactory. The plugin has an option to back up all uploads, and by checking that in settings it uploads all your photos twice, with a backup in /wp-content/uploads/iw-backup/. What I did was enabling watermarking for all versions of the uploaded … Read more

Any specific reason why images do not show on site?

It seems to me that the URL is wrong for the images (HREF). Most like you are modifing or adding content to the site directly from the server while accessing it from http://localhost/. Based on your screenshot, the error message you’re getting on the workstation refers to “localhost/wordpress/content/uploads….” where localhost is the server, BUT in … Read more