如何更改 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/