Home › Forums › Pro Support › Hide container when post list is empty › Reply To: Hide container when post list is empty
August 2, 2018 at 5:04 pm
#5543
Keymaster
I wonder if you could do this:
jQuery( document ).ready( function( $ ) {
$( '.wp-show-posts' ).each( function() {
var _this = $( this );
if ( 'Sorry, no posts were found.' === _this.find( 'p:first-child' ).text() ) {
_this.closest( '.generate-sections-container' ).hide();
}
} );
} );