Dear visitors of the blog SoftMaker.kz. Today I would like to discuss how to insert a code of context advertisement in
the body of articles using the PHP language (ru).
- Some rules of placing advertisement in the body of articles
- Inserting an ad between paragraphs of the article
- A function for replacing a tag <!–advertisement–> in the body of the article
- Combining methods of ads insertion in the body of the articles for achieving the best results
Some rules of placing advertisement in the body of articles
- It is no good when there are too many ads in the body of the article and it complicates the reading.
- Also it is not convenient when the advertisement code goes right under the title of the article and it’s hard to understand where the title and the advertisement code are. After the article’s title an ad should be inserted at least between two first paragraphs.
- You don’t want to insert the ad in the center of the paragraph thus breaking it into two parts. It’s better to insert a context ad between the paragraphs.
- It would be good if ad blocks are separated by one thousand or more characters.
Inserting an ad between paragraphs of the article
In order to insert a block of context ad , it is necessary to determine places for advertisement block in the body of article using the rules described above. In harmony with these rules, this is a space between the paragraphs. How to get the needed values which will indicate such places between the paragraphs?