woocommerce - woocommerce 缩略图替换为原始图像过滤器
问题描述
我在 woocommerce 中的问题:
<img width="150" height="150" src="http://localhost/wordpress/wp-content/uploads/2020/04/Handmade-e1588339358176-150x150.jpg" class="attachment-woocommerce_thumbnail size-woocommerce_thumbnail" alt="" />
我希望它如何:
<img width="150" height="150" src="http://localhost/wordpress/wp-content/uploads/2020/04/Handmade-e1588339358176.jpg" class="attachment-shop_catalog size-shop_catalog wp-post-image" alt="" />
在functions.php中我有
add_filter( 'woocommerce_get_image_size_thumbnail', function( $size ) {
return array(
'width' => 150,
'height' => 150,
'crop' => 1,
);
});
或者无论如何要删除 width="" 和 height="" 属性......所以我让我的 imgs 从 css 响应?
解决方案
推荐阅读
- python - 我可以在类中的函数中导入和使用来自不同 python 文件的变量吗
- python - 尝试使用 numpy 在 Python 中创建自定义函数
- python - 拆分字符串并按多个条件追加
- ocaml - Ocamlfind 的问题:动态加载的库出错
- python - Python错误:AttributeError:'tuple'对象没有属性'write'
- c# - 单击链接时,blazor 不会更改页面
- javascript - 如何防止父元素的宽度影响子元素的宽度?
- dialogflow-es - dialogflow 可以支持希伯来语吗
- django - Django项目的301重定向路由器
- python - 更新字符串替换以忽略列表中的值