You have used the code of this question (Show content after the first and second paragraph) and it works correctly for me.
<?php
$paragraphAfter[1] = '<div>AFTER FIRST</div>'; //display after the first paragraph
$paragraphAfter[3] = '<div>AFTER THIRD</div>'; //display after the third paragraph
$paragraphAfter[5] = '<div>AFTER FIFtH</div>'; //display after the fifth paragraph
$content = apply_filters( 'the_content', get_the_content() );
$content = explode("</p>", $content);
$count = count($content);
for ($i = 0; $i < $count; $i++ ) {
if ( array_key_exists($i, $paragraphAfter) ) {
echo $paragraphAfter[$i];
}
echo $content[$i] . "</p>";
} ?>
I've been watching and remixing. But I have not found the way to add a call type "get_template_part". I do not recognize the part of get_template_part. Where is the error, or can not be done?
Change this:
$paragraphAfter[1] = '<div>AFTER FIRST</div>';
For this:
$paragraphAfter[1] = '<div> get_template_part( 'ad-first' );</div>';
I have tried to make a simple echo, but there is something that I fail
$paragraphAfter[1] = '<div> echo "Hello world!"; </div>';
I can not get it to work :-( Any help or guidance is welcome, thanks