[Plugin: Random / Rotating Ads V2] Ads in post content
-
So if You want to add your ads into post body, all you need is add following code to wp-content/plugins/datafeedr-ads/datafeedr-ads.php
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');
And now anywhere in post content you may add code like following:
[ad-4298077]
where 2346323 copy pasted from Template code:
<?php if (function_exists('dfrads')) { echo dfrads('4298077'); } ?>
Viewing 6 replies - 1 through 6 (of 6 total)
Viewing 6 replies - 1 through 6 (of 6 total)
- The topic ‘[Plugin: Random / Rotating Ads V2] Ads in post content’ is closed to new replies.