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

Customize all image captions

Depending on whether the captions are using the same CSS class or HTML tag, you can add a :before pseudo element to the CSS. This will add an image before every <caption> tag on your website. caption:before { content: ”; display: inline-block; background: url(‘your-image-url-here’); background-repeat: no-repeat; background-size: contain; background-position: center center; height: 15px; width: 15px; … Read more

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