当我打开 url mydomain.com/shop 时,我可以看到活动类别的行。我想创建相同的视图,但找不到 woocommerce 如何构建此 HTML 代码:
<img
src="https://www.example.com/wp-content/uploads/2020/01/dog-categorry-640x640.png"
alt="Dog"
width="450"
height=""
srcset="
https://www.example.com/wp-content/uploads/2020/01/dog-categorry-640x640.png 640w,
https://www.example.com/wp-content/uploads/2020/01/dog-categorry-100x100.png 100w,
https://www.example.com/wp-content/uploads/2020/01/dog-categorry-300x300.png 300w,
https://www.example.com/wp-content/uploads/2020/01/dog-categorry-150x150.png 150w,
https://www.example.com/wp-content/uploads/2020/01/dog-categorry-768x768.png 768w,
https://www.example.com/wp-content/uploads/2020/01/dog-categorry.png 1000w" sizes="(max-width: 450px) 100vw, 450px">
我确实了解以上所有 HTML 代码都从 archive-product.php 文件开始,但如果我尝试在我的小部件上重新创建它就行不通了。谁能解释我在哪里可以找到构造这个 img HTML 代码的 PHP 代码?
或者至少如何获取 srcset 中提到的所有链接?
SMILET