Hi,
I started this new topic because the old one is closed: http://wordpress.org/support/topic/plugin-random-rotating-ads-v2-ads-in-post-content?replies=7
I did what mentioned, and it works partially. I can insert an ad into a page or a post, BUT if I want to add a new ad or edit anything, I can't save it. I have to start a new campaign all over again.
this is the code I added taken from the old post.
function datafeedr_ads_filter($content) {
preg_match_all('/\[ad-([^\]]+)\]/six', $content, $matches);
if(!empty($matches)) {
$codes = $matches[0];
$ids = $matches[1];
for($i = 0; $i < count($codes); $i++) {
$code = $codes[$i];
$id = $ids[$i];
$ad = '';
if (function_exists('dfrads')) {
$ad = dfrads($id);
}
$content = str_replace($code, $ad, $content);
}
return $content;
}
return $content;
}
add_filter('the_content', 'datafeedr_ads_filter');