gpt4 book ai didi

php - 如何更改 WooCommerce 产品页面中的

标签

转载 作者:行者123 更新时间:2023-12-05 01:45:42 62 4
gpt4 key购买 nike

如何更改 woocommerce 中的产品标题 h1 标签?我的页面上已经有一个 h1 标签,并且希望产品名称为 h2。

当前标题来自:

do_action( 'woocommerce_single_product_summary_single_title' );

最佳答案

You can override the default WooCommerce title.php template by your own theme.

复制woocommerce/templates/single-product/title.php并将其粘贴到 woocommerce/single-product/title.php 下的事件主题中

更改此行 the_title( '<h1 itemprop="name" class="product_title entry-title">', '</h1>' );the_title( '<h2 itemprop="name" class="product_title entry-title">', '</h2>' );

代码已经过测试并且功能齐全。


引用

关于php - 如何更改 WooCommerce 产品页面中的 <H1> 标签,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40649122/

62 4 0