remove_filter( 'the_content', 'wpautop' );
add_filter( 'the_content', 'wpautop' , 99 );
add_filter( 'the_content', 'shortcode_unautop', 100 );
Work for almost all my shortcodes excluding one that returns a list of custom post type thumbnails like this:
<li>
<a href="#">
<div class="image-container">
<div class="image"></div>
<div class="overlay"></div>
</div>
<p></a>
</li>
No matter what I do it always adds this <p> before </a> despite returning them inline (I don't even have single space between them in my shortcode source, eg.
<?php while ( $loop->have_posts() ) : $loop->the_post(); ?>
<li><a href="#"><div class="image-container"><div class="image"></div><div class="overlay"></div></div></a></li>
<?php endwhile; ?>
Is there any way of removing this empty P from my shortcodes output?
