I am using wordpress, and I wish to add the adsense javascript tags in which the Find Out More tag gets into a blogpost. It's saved as <!--more--> within the database, however when you use the_content() this really is instantly transformed before I've the opportunity to make use of a str_replace() function.

I am searching to put an adsense tag for every publish within the single.php page in which the teaser finishes. Has anybody been able to perform this?

  1. Produce a filter on the content, to trigger text manipulation between retrieval and rendering.

  2. Define a shortcode to produce something similar to [adsense] place the inside a publish. When made WordPress calls your function, to exchange the code by some text.

If every publish should be transformed make use of the filter. Make use of the shortcode if you wish to have the ability to trigger alternative per publish.