Support Forum

Please login to receive premium support.

Support for the free plugin can be found here.

Home Forums Pro Support Hide container when post list is empty Reply To: Hide container when post list is empty

#5543
Tom
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();
        }
    } );
} );