Why won’t these imported images show up?

I am assuming that WP takes the additional parameters at the end of the file name to automatically resize the image… WordPress adds those suffixes when it creates the images, which is typically done on image upload. Those images should be on the server. By default (and if I am not mistaken), WordPress does not … Read more

How to output placeholder image if no featured image set?

I think that you’re adding the code inside the loop of index.php or blog template file. You might be try this kind of things: if ( class_exists( ‘MultiPostThumbnails’ ) && ( MultiPostThumbnails::has_post_thumbnail( get_post_type(), ‘header-image’ , get_the_ID() ) ) ) { MultiPostThumbnails::the_post_thumbnail(get_post_type(), ‘header-image’, NULL, ‘header-image-full’, array(‘class’ => “custom-header-image”) ); } else { $image = get_template_directory_uri() .’/assets/img/placeholders/placeholder.png’; … Read more

Disabling auto-resizing of uploaded images

To disable resizing for all image sizes without manually removing each size with remove_image_size function, use the filter intermediate_image_sizes_advanced /** * @param array $sizes An associative array of image sizes. * @param array $metadata An associative array of image metadata: width, height, file. */ function remove_image_sizes( $sizes, $metadata ) { return []; } add_filter( ‘intermediate_image_sizes_advanced’, … Read more

How to default all users to no link for attachments?

This is the final non-JS method that finally worked for me: Step 1: update sitewide option You can do this several ways. Since setting it is a one-time operation, I opted to update this by visiting https://www.example.com/wp-admin/options.php . I searched for “image_default_link_type” and set it to “none” (the word none, not null), then saved the … Read more

Crop image without scaling or resizing with add_image_size()

You cant do that with the add_image_size() function, after a lot of research and digging in the core files, what the Hard Crop option of the add_image_size() function actually does is resize the image using the lower dimension, then it will crop the size specified by example if you create a new image size: add_image_size( … Read more

Link to File URL by default

Answered a similar question on the .org forums very recently. To sum it up though.. Go to http://example.com/wp-admin/options.php (replace example.com with your website address) Scroll down the page until you see image_default_link_type Set that option to either file, post or to an empty value. Empty = No link File = Links to the file(what you … Read more