【问题标题】:Change woocommerce product names into h2将 woocommerce 产品名称更改为 h2
【发布时间】:2018-08-22 10:58:12
【问题描述】:

我正在使用带有扁平主题的 woocommerce。 我想在类别页面上的产品名称中添加 标题。

现在分类页面的源代码是这样的:

<div class="title-wrapper"><p class="name product-title"><a href="https://www.shop.com">product-1</a></p></div>

我想对此进行更改,或类似的内容:

<h2><div class="title-wrapper"><p class="name product-title"><a href="https://www.shop.com">product-1</a></p></div></h2>

【问题讨论】:

  • 通常默认情况下,已经有一个&lt;h2&gt;标签,你可以看到on this code source所以你的Flatsome主题已经做了一些自定义。您最好寻求作者的支持,因为它是一个高级主题。
  • 不是对您问题的回答,而是一种观察——您想要的不是有效的 HTML。 &lt;h2&gt; 内不能有 &lt;p&gt;。您需要使用&lt;div class="title-wrapper"&gt;&lt;h2 class="name product-title"&gt;&lt;a href="https://www.shop.com"&gt;product-1&lt;/a&gt;&lt;/h2&gt;&lt;/div&gt;

标签: wordpress woocommerce


【解决方案1】:

由于您没有提供当前网站的任何链接,因此我无法为您提供直接而具体的答案。

但您可以通过编辑主题的 woocommerce 模板来更改此设置。确保您首先创建一个子主题(始终是一个好习惯,这样您就不会失去自定义)

如果您有 cpanel 或 FTP,您只需转到文件管理器并浏览主题随附的 woocommerce 模板。然后更改@Peter提到的代码

    <div class="title-wrapper"><p class="name product-title"><a href="https://www.shop.com">product-1</a></p></div>

    <div class="title-wrapper"><h2 class="name product-title"><a href="https://www.shop.com">product-1</a></h2></div>

如果你找不到,你可以给我你的网站网址,我会为你提供具体的解决方案。

【讨论】:

    猜你喜欢
    • 2020-07-20
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-04-27
    • 1970-01-01
    • 2019-11-12
    相关资源
    最近更新 更多