How to load only a certain type of image (functions.php)

You can use some JavaScript to add a quick validation that checks the file type when someone tries to add an image. Place this script in your theme’s main JS file or inline in your functions.php. Here’s a snippet of JavaScript to give you an idea: jQuery(document).ready(function($) { wp.customize.control(‘themeslug_logo’, function(control) { control.uploader.params.allowed_extensions = [‘png’]; control.container.on(‘click … Read more

Image size not showing up in ‘wp/v2/media’

If you register an image size of 1000×1000 then upload an image with an original resolution of 500×500, WordPress will resize it to create smaller versions, but it will not upscale the image to create larger versions. This is because a larger version would be bigger but have the same resolution, WordPress can’t invent details … Read more