Блок или код в определённом месте статьи

// ВЫВОД РЕКЛАМНОГО БЛОКА ПОСЛЕ ОПРЕДЕЛЕННОГО АБЗАЦА ЗАПИСИ
add_filter( 'the_content', 'wpse_ad_content' );
function wpse_ad_content( $content ) {
        if( !is_single() )
            return $content;
            $paragraphAfter = 2; //АБЗАЦ, ПОСЛЕ КОТОРОГО БУДЕТ ВЫВОДИТЬСЯ РЕКЛАМА.
            $content = explode ( "</p>", $content );
            $new_content = '';
                for ( $i = 0; $i < count ( $content ); $i ++ ) {
                    if ( $i == $paragraphAfter ) {
                    $new_content .= 'Сюда код рекламы';
                    }
            $new_content .= $content[$i] . "</p>";
            }
            return $new_content;
    }