I replaced
- Code: Select all
<?php the_content(); ?>
with this
- Code: Select all
<?php
$paragraphAfter= 1; //shows the ad after paragraph 1
$content = apply_filters('the_content', get_the_content());
$content = explode("</p>", $content);
for ($i = 0; $i <count($content); $i++) {
if ($i == $paragraphAfter) { ?>
<!-- START OF AD CODE -->
PASTE AD CODE HERE
<!-- END OF AD CODE -->
<?php
}
echo $content[$i] . "</p>";
} ?>
Unfortunately this method does not work on your theme. Could you please give me simple solution to make it working?