展望放在同一行/列的图形作为H3标题是这样的:创建WordPress的简码,禁用wpautop()上包裹的内容吗?
<h3 style="display:inline;">Graphic Advantage</h3><img style="max-width: 50px; width: 100%;" src="https://sgdesign.com/images/SGDadvantage.png" alt="SGD Advantage" />
首先,我让H3显示=直列所以它仅占它的实际宽度,而不是整行。我可以浮在H3和图形左边,然后做一个clearfix但似乎过度。目标是简单地将h3和小图形放在同一行上。
它失败,因为Wordpresses自动格式化功能wpautop(),它自动地设置,一个段落标签<的p>
但尚未当二次内容(图形)被包裹在一个短码工作的:
<h3 style="display: inline;">Advantage SGDesign</h3>
[tooltip text="Throughout our site you'll see this icon that will help identify significant differences between SGDesign and other companies"]<img style="max-width: 50px; width: 100%;" src="https://sgdesign.com/images/SGDadvantage.png" alt="SGD Advantage" />[/tooltip]
问题:最佳实践以某种类型的包裹标签内挫败wpautop()函数?
也许创建一个空的简码像
function no_wp_autoformat_shortcode() {
return null;
}
add_shortcode('nowpautop', 'no_wp_autoformat_shortcode');
这是可行的,但现在它隐藏在包裹< IMG ...
所以,问题变为如何使图像显示在被包裹短代码 ?
<h3 style="display:inline;">Graphic Advantage</h3>[nowpautop]<img style="max-width: 50px; width: 100%;" src="https://sgdesign.com/images/SGDadvantage.png" alt="SGD Advantage" />[/nowpautop]
是的,我已经阅读如何停止自动格式化,宁愿不失去功能,从而试图找出如何写一个短代码实现了比包装之外的元素空效果。 – Burndogz