Image file sizes increasing on upload

OK I seem to have found the answer to this. The theme I’m using has Aqua Resizer installed. Quality was set to 100% which for some reason made the resized versions bigger in file size. I’ve changed the quality setting to 80 and it has sorted it.

Passing srcset to image attachment method

I can’t say I’ve tested this but here’s what you could to, it should in theory work. The wp_get_attachment_image() functions 4th parameter is an array of attributes. You should be able to pass what you get returned from wp_get_attachment_image_srcset() to the attribute parameter as follows, sort of similar to the example seen on the docs. … Read more

Upload thousands of images to WordPress without plugin?

I’ve modified method wp_update_attachment_metadata from wp-includes/post.php (line 5070) to this, just during the Import: /** * Update metadata for an attachment. * * @since 2.1.0 * * @param int $attachment_id Attachment post ID. * @param array $data Attachment meta data. * @return int|bool False if $post is invalid. */ function wp_update_attachment_metadata( $attachment_id, $data ) { … Read more

How to disable the suffix “-scaled” which is being added at the end of each uploaded image?

How to disable this behaviour? Add this to your functions.php: add_filter( ‘big_image_size_threshold’, ‘__return_false’ ); How does it work? When a new image is uploaded, WordPress will detect if it is a “big” image by checking if its height or width exceeds the big_image threshold. The default threshold value is 2560px, filterable with the new big_image_size_threshold … Read more

How to Add extra option to Image Block Settings?

This can be done using block filters. First, you’ll need to filter block attributes for the image block to be able to save the new items: const { addFilter } = wp.hooks; function filterAttributes( settings, name ) { if ( ‘core/image’ === name && settings.attributes ) { settings.attributes.description = { type: ‘string’, default: ” }; … Read more

How to install Imagick or resolve issue

It seems as though you dont have the required permissions to install this PHP extension. This is often the case when youre using shared hosting. The best option is to contact your hosting provider and ask them to install this php extension. However if they provide you with a cpanel dashboard you may be able … Read more

How do i reference the theme path in pages for images?

Use get_template_directory_uri() print get_template_directory_uri() . ‘/image.jpg’; In child themes use get_stylesheet_directory_uri() if you have replaced the image. In a shortcode this would look like this: <?php /* Plugin Name: Theme URI Shortcode */ add_shortcode(‘theme_uri’, ‘wpse_66026_theme_uri_shortcode’ ); function wpse_66026_theme_uri_shortcode( $attrs = array (), $content=”” ) { $theme_uri = is_child_theme() ? get_stylesheet_directory_uri() : get_template_directory_uri(); return trailingslashit( $theme_uri … Read more

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