This new fabulous feature of Header and Footer has been requested few times and I introduced it for a my personal need on a big blog I manage.
How does it work?
It is not easy to control all that in a scientific was, but we are not scientists, we need only to put an ad in the middle of a post.
So the natural rule were: add this piece of cool code just before the first <h2> you find but start searching for it after 700 characters from the start of the post. You know a post contains HTML tag so 700 characters and actually not 700 human readable characters, but still we are no scientists.
This rule is so clear that it toke to me few minutes to implement (of course using the code already written in that big blog in a custom plugin…).
Another interesting way to find an injection point is the <p> tag, or the closing </p> tag. For example you may want to add something just after the first post paragraph. The rule will be: add that just after the first </p>, of course starting to search from the top of the article.
Why to inject before or after an HTML tag? Rather simple, because you don’t want to break up your so carefully written article, right?
There are special case on may want to manage: what if the <h2>tag is not found on a specific article? Maybe we want to recycle that code and inject it at least on top or bottom of the article (you know, loose ad impressions is not good). The rule has an option for that as well.
Now it’s up to you: add your own rules and inject the ads in the most profitable position and… share with me your results!