You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

WordPress小部件内HTML标签修改:将i标签替换为em标签

Hey there! As someone new to PHP and WordPress, swapping out that <i> tag for an <em> tag is straightforward—let's walk through it.

First, here's your modified footer code with the <em> tag in place of the <i> tag:

<footer id="colophon" class="site-footer"> 
  <div class="container"> 
    <div class="row"> 
      <div class="footer col-sm-12"> 
        <div class="smicon-box icon-left"> 
          <div class="boxes-icon"> 
            <span class="inner-icon"> 
              <span class="icon"> 
                <em class="fa fa-calendar"></em> 
              </span> 
            </span> 
          </div> 
        </div> 
      </div> 
    </div> 
  </div> 
</footer>

Step-by-Step Guide:

  1. Locate the template file: This footer code is almost certainly in your WordPress theme's footer.php file (found in wp-content/themes/[your-theme-name]/). If it's part of a custom widget, check the widgets folder in your theme or any custom plugin files you're using for footer widgets.
  2. Find the target line: Look for the line <i class="fa fa-calendar"></i> in the file.
  3. Replace the tag: Swap <i> with <em>—make sure you keep the class="fa fa-calendar" attribute intact, since that's what tells Font Awesome which icon to display.
  4. Save and test: Save the file, then refresh your website. The calendar icon should render exactly as before, but now using the <em> tag instead of <i>.

Font Awesome supports using <em>, <span>, or other inline elements in place of <i> for icons, so this change won't break the icon display at all.

内容的提问来源于stack exchange,提问作者newbie

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.13 09:05:44