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:
- Locate the template file: This footer code is almost certainly in your WordPress theme's
footer.phpfile (found inwp-content/themes/[your-theme-name]/). If it's part of a custom widget, check thewidgetsfolder in your theme or any custom plugin files you're using for footer widgets. - Find the target line: Look for the line
<i class="fa fa-calendar"></i>in the file. - Replace the tag: Swap
<i>with<em>—make sure you keep theclass="fa fa-calendar"attribute intact, since that's what tells Font Awesome which icon to display. - 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
相关产品推荐
相关产品推荐

