OUTPUT BUFFERING
ABOVE HEADER

Press enter to see results or esc to cancel.

BEFORE POST

Automatic Insertion Between Paragraphs

BEFORE CONTENT 676 words
BEFORE PARAGRAPH 149 words

This page demonstrates Ad Inserter automatic insertion between paragraphs. For this purpose we’ll use automatic insertion before paragraph but we’ll not specify paragraph numbers directly, we’ll use Filter for this purpose. We’ll insert ads before every third paragraph and we’ll also count <ul> elements below (list with bullet points) as paragraphs.

AFTER PARAGRAPH 1
BEFORE PARAGRAPH 255 words

Paragraph is a section of text between listed tags (normally only <p> tags are used). Paragraph counting can be from the top (default) or from the bottom of the page. You can also define what is counted as paragraph (button Counting) and where to avoid insertion (button Clearance), but for this demo we’ll use default values.

AFTER PARAGRAPH 2
BEFORE PARAGRAPH 35 words
[AI]8   DEMO Between paragraphs   N=1[/AI]

Paragraph number(s):

AFTER PARAGRAPH 3
  • value 1 or more means paragraph number
  • negative value -1 or less means paragraph number counted from the opposite direction as configured
  • value between 0 and 1 means relative position in post or page (e.g. 0.3 means paragraph 30% from top or bottom)
  • 0 means random paragraph position
  • %N means insertion every N paragraphs
  • Empty value means all paragraphs – you can use Filter (button Misc / tab Filter) to define insertions like in this example, but you can also use %N also as paragraph number
BEFORE PARAGRAPH 458 words

With Filter you can define which insertions are enabled – single number or comma separated numbers. %N filter item means filter every N-th insertion. Filter also works for paragraph counting. Leave Paragraph(s) empty, set filter to Paragraphs and define comma separated list of paragraph numbers where the code should be inserted (%N can also be used). Invert Filter inverts insertion – listed insertions are skipped.

AFTER PARAGRAPH 4
BEFORE PARAGRAPH 519 words
[AI]8   DEMO Between paragraphs   N=2[/AI]

This is useful in many cases where you can’t remove unwanted insertions of the code with other settings, for example:

AFTER PARAGRAPH 5
  • If you need to insert ad before the first, third and fifth excerpt on the homepage you simply specify 1, 3, 5 for the filter.
  • If you need to insert an ad between the second and third comment and between the fourth and fifth comment on posts you set 2, 4 for the filter.
  • If you need to insert an ad every fifth comment on posts you set %5 for the filter.
  • In some WP themes hooks (that call Ad Inserter insertion functions) are called more than once. In such case you might get unwanted insertions. Simply set the filter to the number of the wanted call(s). Use debugging function Show positions on every post/page to show available positions for automatic insertion with counters.
BEFORE PARAGRAPH 645 words

Paragraphs are not counted inside special elements: <blockquote>, <figure>, <li>. Of course, there is an option to enable counting also inside these special elements and you can define these special elements – No Paragraph Counting Inside setting on the tab  / tab General.

AFTER PARAGRAPH 6
BEFORE PARAGRAPH 744 words
[AI]8   DEMO Between paragraphs   N=3[/AI]

Paragraph processing works on every post or page according to the settings. Therefore, if you enable insertion also on blog pages (home, category, archive, search pages) and your theme does not display post excerpts but complete posts, Ad Inserter will by default insert code blocks into ALL posts on the blog page (according to the settings).

AFTER PARAGRAPH 7
BEFORE PARAGRAPH 834 words

Each code block you insert in the post adds one <div> element (with your code) unless you use No wrapping style. This is important if you count also <div> elements as paragraphs.

AFTER PARAGRAPH 8
BEFORE PARAGRAPH 925 words

Before Paragraph automatic insertion will insert code before the opening paragraph <tag>, After Paragraph automatic insertion will insert code after the closing paragraph </tag>

AFTER PARAGRAPH 9
BEFORE PARAGRAPH 1029 words
[AI]8   DEMO Between paragraphs   N=4[/AI]

After Paragraph automatic insertion will work even if you specify tag names that have no closing tags (e.g. images using <img> tag) since Ad Inserter uses special processing for such cases. 

AFTER PARAGRAPH 10
BEFORE PARAGRAPH 1134 words

If you are inserting the same ad on multiple positions on posts (with the same counting and clearance settings) use one code block and specify all paragraph numbers. This will speed up insertion as the post will be processed only once.

AFTER PARAGRAPH 11
BEFORE PARAGRAPH 1229 words

The text below (Settings used) is wrapped with a <div> and the plugin is configured to not count paragraphs inside <div> elements.

AFTER PARAGRAPH 12

Settings used

ad inserter between paragraphs

Whe have inserted all the ads with only one block with automatic insertion set to Before paragraph, no paragraph numbers defined (empty field) and filter set to %3 using Paragraphs counter.

Empty field for Paragraph(s) means all paragraphs that count, Filter set to %3 using Paragraphs counter means insert every 3rd paragraph.

AFTER CONTENT
POST
AFTER POST
FOOTER
POST
Skip to toolbar