[187 lines collapsed] /** * Fallback: if homepage still has the old static .prod-grid cards, * swap them for live products automatically. * swap them for live products. Uses a simple div-depth walk * (no regex) so large homepage HTML cannot hang PHP / cause 504. */ add_filter( 'the_content', function ( $content ) { if ( is_admin() || ! is_front_page() || false === strpos( $content, 'prod-grid' ) ) { if ( is_admin() || wp_doing_ajax() || ! is_front_page() ) { return $content; } if ( ! is_string( $content ) || false === strpos( $content, 'prod-grid' ) ) { return $content; } if ( false !== strpos( $content, 'nisa-home-products' ) || false !== strpos( $content, '[nisa_homepage_products' ) ) { return $content; } $start = strpos( $content, '
' ); if ( false === $start ) { return $content; } $end = nisa_find_matching_div_end( $content, $start ); if ( false === $end ) { return $content; } $replacement = nisa_homepage_products_html( 8 ); if ( '' === $replacement ) { return $content; } $updated = preg_replace( '/
[\s\S]*?<\/div>\s*(?=<\/div>\s*<\/section>)/', $replacement, $content, 1 ); return is_string( $updated ) ? $updated : $content; return substr( $content, 0, $start ) . $replacement . substr( $content, $end ); }, 20 ); /** * Find the position just after the closing
that matches the * opening
at $start. Returns false on failure. */ function nisa_find_matching_div_end( $html, $start ) { $length = strlen( $html ); $pos = $start; $depth = 0; while ( $pos < $length ) { $next_open = stripos( $html, '', $pos ); if ( false === $next_close ) { return false; } if ( false !== $next_open && $next_open < $next_close ) { $depth++; $pos = $next_open + 4; continue; } $depth--; $pos = $next_close + 6; if ( 0 === $depth ) { return $pos; } } return false; } Nisa House
Quality ยท Comfort ยท Style

Bedsheets folded with love, made for your home.

Premium cotton bedding and everyday ladies wear, hand-picked in small batches. Cash on delivery, nationwide โ€” because good sleep shouldn’t wait.

Cash on Delivery DM to Order 124+ happy customers
โœจ New floral collection
New floral collection
Shop by category

Two worlds, one home.

From bedsheet sets to everyday ladies wear โ€” every piece is chosen for comfort first.

๐Ÿงต

Premium Fabric

100% cotton bedsheets, breathable and soft-washed for everyday comfort.

๐Ÿšš

Cash on Delivery

Pay when your order arrives at your door โ€” no advance needed.

๐Ÿ’ฌ

DM to Order

Message us your size and design, and we’ll confirm within the hour.