I have a shortcode to create columns, such that the page in the editor (text view) looks like this;
[two-column]<ul>
<li>Annual statutory accounts preparation</li>
<li>Independent Examination service</li>
<li>Audit file preparation</li>
<li>Gift Aid returns</li>
<li>Payroll</li>
</ul>[/two-column]
[two-column]<ul>
<li>Bookkeeping service</li>
<li>Management accounts</li>
<li>Charity Commission administration service</li>
<li>OSCR administration service</li>
<li>Companies House administration service</li>
</ul>[/two-column]
Unfortunately when on the page it appears like this;
<p><div class="two-column">
<ul>
<li>Annual statutory accounts preparation</li>
<li>Independent Examination service</li>
<li>Audit file preparation</li>
<li>Gift Aid returns</li>
<li>Payroll</li>
</ul>
<p></div><br />
<div class="two-column">
<ul>
<li>Bookkeeping service</li>
<li>Management accounts</li>
<li>Charity Commission administration service</li>
<li>OSCR administration service</li>
<li>Companies House administration service</li>
</ul>
<p></div></p>
</div>
Now I don't want to remove all <p>
tags (by manipulating wpautop), so how do i process this shortcode.
The shortcode;
function column_shortcode($atts = [], $content = null)
{
$content = '<div class="two-column">'.$content.'</div>';
return $content;
}
add_shortcode('two-column', 'column_shortcode');
[/two-column]
and second's opening[two-column]
on the same line and using the solution for this question should do the trick: wordpress.stackexchange.com/questions/239620/…wpautop()