简体   繁体   English

如何获取图像作为我的 Woocommerce 商店页面标题背景?

[英]How can I get an image as my Woocommerce shop page header background?

My Woocommerce category pages have the option to change thumbnail and it goes on the header area of the page (under the main menu), but there isn't such option for Woocommerce shop page.我的 Woocommerce 类别页面可以选择更改缩略图,它位于页面的标题区域(在主菜单下),但 Woocommerce 商店页面没有这样的选项。 Maybe because it is an archive page?也许是因为它是一个存档页面?

My Woocommerce shop page header has a white background, so there is a white space between main menu and products.我的 Woocommerce 商店页面标题有白色背景,因此主菜单和产品之间有一个空白区域。 Page title also is displayed in this area.页面标题也显示在此区域中。 I know how to change this background color, but I would like to upload an image.我知道如何更改此背景颜色,但我想上传图片。

So - How can I get an image as my Woocommerce shop page header background?那么 - 如何获得图像作为我的 Woocommerce 商店页面标题背景?

Thank you!谢谢!

You should be able to fix this quite easily with CSS.您应该能够使用 CSS 轻松解决此问题。

.opacity-light.bg-dark-gray {
  opacity: 1;
  background-image:url('IMAGE_URL_HERE');
}

To be certain it doesn't override your other pages, you could be more specific with the selector so that it only targets the div on that type of page, so:为了确定它不会覆盖您的其他页面,您可以更具体地使用选择器,以便它仅针对该类型页面上的 div,因此:

.post-type-archive-product .opacity-light.bg-dark-gray { .. }

Hope that helps!希望有帮助!

I had the same issue with my site using SKT builder .我的网站使用SKT builder 时遇到了同样的问题。 To change the grey header of the shop page.更改商店页面的灰色标题。 Click " Customize (live preview) >> Post & Page >> Post Header Setting ".单击“自定义(实时预览)>>帖子和页面>>帖子标题设置”。

Insert image you want to display by clicking "Select Image"单击“选择图像”插入要显示的图像

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM