function add_custom_div_block_after_first_paragraph( $content ) { // Only apply to the main page if ( is_home() || is_front_page() ) { // Check if content has paragraphs if ( strpos( $content, '
' ) !== false ) { // Split content into array of paragraphs $paragraphs = explode( '', $content ); // Get the first paragraph $first_paragraph = $paragraphs[0]; // Add the custom div block after the first paragraph $content = str_replace( $first_paragraph . '', $first_paragraph . '' . '