【问题标题】:How to add header H2 in PHP class如何在 PHP 类中添加标题 H2
【发布时间】:2019-03-04 21:20:58
【问题描述】:

我正在尝试获取类“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>

谢谢

【问题讨论】:

  • 抱歉,不清楚(对我来说)你在问什么。没有"aawp-product__title",没有&lt;h2&gt;
  • 你了解自己的问题吗?

标签: php header


【解决方案1】:

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

【讨论】:

    【解决方案2】:

    我不知道你真正想要实现什么,但这应该对你有好处

    <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?

    【讨论】:

      猜你喜欢
      • 2017-11-28
      • 1970-01-01
      • 1970-01-01
      • 2020-07-09
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多