Inline ads after x paragraph

Posted in: Newspaper
Post count: 8

Hi,

I have an issue with the position of the inline ads. It appears to be random on my website… Can you explain how works the paragraph calculation ?
Please see below 2 links with different position (setup as “after 2 paragraph” in theme panel)
– Correct position : https://www.running-addict.fr/conseil-running/comment-ameliorer-son-endurance/
– Almost at the botton : https://www.running-addict.fr/conseil-running/parcours-du-marathon-de-paris-2018-analyse/

Second question, would it be possible to position the ads before paragraph title and not after ? (I use h2 as a paragraph title)

Thanks

Post count: 20688

Hi,

The inline ad should appear after a set number of paragraphs (actual p tags). I have inspected the posts you mention, it seems the inline ad in the first post is appearing after 2 paragraphs (that is happening in all other posts I inspected)
https://www.screencast.com/t/5OHNWPHkkd3
But in the other one it does not seem to work properly from what I can see, it still appears after the second paragraph however
https://www.screencast.com/t/4T92g7vclV
Try changing the number of paragraphs for the inline ad, see if it works. Let us know the results.

Thanks

Post count: 8

Ok I understand. Basically you are considering p tags as paragraphs, but wordpress default tag for paragraph creation is div tag.
Is there any option to consider div as a paragraph tag then?
I have more than 500 posts that are based on div tag that I would need to update if not…

Post count: 20688

I don’t think the default post content tag is the div, I believe it is the paragraph. I have tried on a default WordPress theme
https://www.screencast.com/t/GqyEEy95n6Xz
https://www.screencast.com/t/Rd7nE69TfTgU
This is how the theme inline ad was created, it counts paragraphs. the function is defined here
https://www.screencast.com/t/nIBbyVGDUF
You could try to change the p tags with a div tags in that function, then check if it works properly, if this is required.

Post count: 8

Thanks a lot ! I really don’t know why I have div tags everywhere instead of p tags but anyway with the proposed code update, it works perfectly, thanks !

Viewing 5 posts - 1 through 5 (of 5 total)
The forum ‘Newspaper’ is closed to new topics and replies.