?'; add_settings_field("aads_client", "AD Client like : ca-pub-00000000000", "aacap_aadclient", "aads-options", "section"); add_settings_field("aads_slot_336_280", "AD Slot 336 * 280", "aacap_aadslot336_280", "aads-options", "section"); add_settings_field("aads_slot_90_200", "AD Slot 90 * 200", "aacap_aadslot90_200", "aads-options", "section"); add_settings_field("aads_slot_content", "Number of Line ".$shar7, "aacap_aadcontent_num", "aads-options", "section"); register_setting("section", "aadclient"); register_setting("section", "aadslot336_280"); register_setting("section", "aadslot90_200"); register_setting("section", "aadcontent_num"); } add_action("admin_init", "aacap_ads_function"); function aacap_ads_content_amp_options(){ ?>

Ads on Content AMP





support us to do more -> Support || Rating
'; $a_ad_90_200 = '
'; //$count = substr_count( $content, '

' ); //Enter number of paragraphs to display ad after. $paragraphAfter = (empty($aadcontent_num)) ? 21 : $aadcontent_num ; $roundParagraph = round($paragraphAfter / 2 ); $content = explode("

", $content); $new_content = ''; for ($i = 0; $i < count($content); $i++) { if ($i % $paragraphAfter == 0) { $number = $i; $new_content.= $a_ad_336_280; } if (!empty($aadslot90_200)) { if ($i == ($number + $roundParagraph)) { $new_content.= $a_ad_90_200; } } $new_content.= $content[$i] . "

"; } $new_content.= $a_ad_336_280; }else return $content; return $new_content; } add_filter('the_content', 'aacap_ads_content_run');