我想将此部分添加到wordpress页面,但每次我添加它时,wordpress都会添加额外的东西,使其无法正常工作,这是我的代码
<li data-hovercolor="#e859c5">
<a href="/digitalways/?page_id=308">
<h2 data-type="mText" class="sti-item">server</h2>
<h3 data-type="sText" class="sti-item"></h3>
<span data-type="icon" class="sti-icon sti-icon-server sti-item"></span></a>
</li>
<li data-hovercolor="#0f96c3">
<a href="/digitalways/?page_id=448">
<h2 data-type="mText" class="sti-item">program</h2>
<h3 data-type="sText" class="sti-item"></h3>
<span data-type="icon" class="sti-icon sti-icon-hardware sti-item"></span>
</a>
</li>
wordpress就是这样做的
<li data-hovercolor="#e859c5">
<a href="/digitalways/?page_id=308">
<p></p>
<h2 data-type="mText" class="sti-item">server</h2>
<h3 data-type="sText" class="sti-item"></h3></a>
<p><a><span data-type="icon" class="sti-icon sti-icon-server sti-item"></span></a></li>
</li>
最合适的回答,由SO网友:Vinod Dalvi 整理而成
将此添加到您的函数中。php,这应该给出您想要的结果:
remove_filter(\'the_content\', \'wpautop\');