OUTPUT BUFFERING
ABOVE HEADER

Press enter to see results or esc to cancel.

BEFORE POST

Automatic Insertion After Paragraph

BEFORE CONTENT 499 words
BEFORE PARAGRAPH 148 words

This page demonstrates Ad Inserter automatic insertion after paragraph. We’ll insert ads after the first paragraph, after the paragraph in the middle of the post and after the second paragraph from the bottom. We’ll also count <ul> element (list with paragraph number descriptions – bullet points) below as paragraph.

[AI]7   DEMO After Paragraph   N=1[/AI]
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

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 – use Filter to define insertions
BEFORE PARAGRAPH 442 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 4
BEFORE PARAGRAPH 549 words

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).

[AI]7   DEMO After Paragraph   N=2[/AI]
AFTER PARAGRAPH 5
BEFORE PARAGRAPH 635 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 6
BEFORE PARAGRAPH 724 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 7
BEFORE PARAGRAPH 829 words

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 8
BEFORE PARAGRAPH 936 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.

[AI]7   DEMO After Paragraph   N=3[/AI]
AFTER PARAGRAPH 9
BEFORE PARAGRAPH 1030 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 10

Settings used

ad inserter after paragraphs

Whe have inserted all three ads with only one block with automatic insertion set to After paragraph, paragraph tags p, ul and paragraph numbers 1, 0.5, -2:

  • 1 means after the first paragraph
  • 0.5 means after the paragraph at 50% of the post
  • -2 means after the second paragraph from the bottom (before the last paragraph)

We could achieve the same result with automatic insertion Before Paragraph and paragraph numbers: 2, 0.5, -1. In this case only the middle ad would be inserted one paragraph upper, but still in the middle of the post.

AFTER CONTENT
POST
AFTER POST
FOOTER
POST
Skip to toolbar