0
X
Add Snippet To Project
New Project
Add To Existing Project
<?php
function wpturbo_add_composition_blocks( $content ) {
if ( is_singular( 'post' ) ) {
$composition_block = '<!-- Insérer ici le code HTML ou le shortcode du bloc de composition -->';
$paragraphs = explode( '</p>', $content );
$new_content = '';
foreach ( $paragraphs as $paragraph ) {
$new_content .= $paragraph . '</p>' . $composition_block;
}
$content = $new_content;
}
return $content;
}
add_filter( 'the_content', 'wpturbo_add_composition_blocks' );