Disable all resizing and compression

Turns out I was never too far off. Adding this to your functions.php will stop all resizing and compression of images uploaded to the media folder add_filter( ‘big_image_size_threshold’, ‘__return_false’ ); add_filter( ‘jpeg_quality’, function($arg){return 100;} ); update_option( ‘medium_size_w’, 9000 ); update_option( ‘medium_size_h’, 9000 ); update_option( ‘large_size_w’, 9000 ); update_option( ‘large_size_h’, 9000 ); Hope this helps someone … Read more

Responsive Header for Phone

When the browser scales down, the theme sets a minimum height for the image, whilst the image width becomes smaller and smaller. The image is set to fill the complete banner, so therefore the image is cropped at the sides. If you add the following code to the ‘Additional CSS’ in the customizer, it should … Read more

Why does Google Image Search still display my images?

This took the index some more time, but after around six weeks, the blocked images are no longer displayed as search results. I am not sure if this will help for future uploads for photos of the same people with different filenames, but I had added strings with placeholders like these: User-Agent: Googlebot-Image Disallow: /wp-content/uploads/*adam*smith*.jpg … Read more

Get the post ID and display the images

As far as I know get_field() function will return the response according to the current post (There’s no need to specify the post ID). But if you want to specify the post ID then you have to type it in the second argument, like: get_field( $selector, $post_id ); So your code would be like this: … Read more

How can I restrict image upload dimensions for non-admin WordPress users?

I’ve modified this answer from brasofilo. Modify the width and height values in the following line in the below code to your needs… $maximum = array( ‘width’ => 500, ‘height’ => 700 ); … and then add the code to your theme’s functions.php file. add_action( ‘admin_init’, ‘wpse_371740_block_authors_from_uploading_large_images’ ); function wpse_371740_block_authors_from_uploading_large_images() { if( !current_user_can( ‘administrator’) ) … Read more