Answer the question
In order to leave comments, you need to log in
Answer the question
In order to leave comments, you need to log in
There are blocks in the HTML code likeThere is a universal way.
< !-- Ad — ->
I need to replace them with adSense code
ob_start("abazaba");
function abazaba($t) {
if(stristr($_SERVER['REQUEST_URI'],'wp-admin')) return $t; //что бы админку не портить
$a='код адсенса';
$t=str_replace('-- ad -- ',$a,$t); //злой парсер захавал нормальный ad
return $t;
}
Wordpress has functions for working with shortcode, see here .
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question