如何在PHP类中添加标题H2

时间:2018-09-28 21:17:13

标签: php header

我正在尝试获取类“ aawp-product__title”的H2标头

<div class="aawp-product__content">
        <a class="aawp-product__title" href="<?php echo $this->get_product_url(); ?>" title="<?php echo $this->get_product_link_title(); ?>" rel="nofollow" target="_blank">
            <?php echo $this->get_product_title(); ?>
        </a>
        <div class="aawp-product__description">
            <?php echo $this->get_product_description(); ?>
        </div>
    </div>

谢谢

2 个答案:

答案 0 :(得分:0)

我不知道您实际上想要实现什么,但这应该对您有好处

<a class="aawp-product__title" href="<?php echo $this->get_product_url(); ?>" title="<?php echo $this->get_product_link_title(); ?>" rel="nofollow" target="_blank">
        <h2><?php echo $this->get_product_title(); ?></h2>
    </a>

Semantically, which is more correct: a in h2, or h2 in a?

答案 1 :(得分:0)

谢谢,我需要的是aawp-product__title回显,它返回的产品标题为H2或H3标头。