add product thumbnail to checkout page only and include variation name

You can use the conditional checks to simply build a new return value for the filter. So run the filter once and put all your code in there. Your second example doesn’t really make sense because no matter what, you’re returning $name, can you explain that more? add_filter( ‘woocommerce_cart_item_name’, ‘cart_variation_description’, 20, 3); function wpse306625_cart_variation_description( $name, … Read more

I want to use a product thumbnail completely different than the product image

There’s several ways you can do it. My suggestion would be to create a custom meta box that either accepts a either the image url or you pass the id of the image you want to use. Then within the template you can use the wp_get_attachement_image($args) function. https://developer.wordpress.org/plugins/metadata/custom-meta-boxes/ https://developer.wordpress.org/reference/functions/wp_get_attachment_image/

How to reduce unnecessary thumbnail creation?

You can use a plugin for this. If you want to do it by writing your own code, you may use remove_image_size(). add_action(‘init’, ‘wpse325870_remove_plugin_image_sizes’); function wpse325870_remove_plugin_image_sizes() { remove_image_size(‘small-A’); } Note that you cannot remove reserved image sizes using this function.

Change thumbnail size for Media Library

This was an interesting question as I knew nothing about modifying the default behaviour of the Media Library. So, I ended up doing some research on the matter. I found out that the Media Library uses wp_ajax_query_attachments() to get the images and other media. Inside the ajax function there’s ajax_query_attachments_args that can be used to … Read more

Clickable product image with hover effect

You can use some Javascript to trigger the click. For example: $(‘.product-thumb’).click(function(event) { var product_link = $(this).find(‘product-thumb-primary a’); // Don’t trigger a click on the existing link if(!event.target.href && product_link.length) { document.location.href = product_link.attr(‘href’); } }); Un-tested but that’s the basic logic.

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