[英]Woocommerce random images in category page
I have a category page on my wordpress / woocommerce site that lists all of the prouct categories and the number of products that are in that category. 我在wordpress / woocommerce网站上有一个类别页面,其中列出了所有产品类别以及该类别中的产品数量。
I think this is generated by content-product.php 我认为这是由content-product.php生成的
Currently a placeholder is displayed but I would like to change this to an image. 当前会显示一个占位符,但我想将其更改为图像。
What I want to do, for each of the categories, is randomly select and display an image from that category instead of the placeholder. 对于每个类别,我要做的是随机选择并显示该类别中的图像,而不是占位符。
I've search on StackOverlflow and all over the net but I can't find an answer. 我已经在StackOverlflow和整个网络上进行搜索,但是找不到答案。 Could someone point me in the right direction please?
有人可以指出我正确的方向吗? I can then try and write some code and see how far I get.
然后,我可以尝试编写一些代码,看看能走多远。
Thanks in Advance. 提前致谢。
Something like this should work: 这样的事情应该起作用:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.