Archived topic
Taboola Ads Inserts into Comments Div Tag Instead of Its Own Div
3 replies · Started by jaypabs on July 18, 2022
Hi,
I'm trying to insert Taboola code after generate_after_main_content. But when the page is rendered, the ads show within the comments div tag. I remove the Taboola code and instead add a few words and it is working fine. It does insert into the right place, that is, after generate_after_main_content.
Here's the code of my Taboola ads:
<div id="taboola-below-article-thumbnails"></div>
<script type="text/javascript">
window._taboola = window._taboola || [];
_taboola.push({
mode: 'thumbnails-a',
container: 'taboola-below-article-thumbnails',
placement: 'Below Article Thumbnails',
target_type: 'mix'
});
</script>
Here's the screenshot using Chrome's inspector:
https://pasteboard.co/6iT7k8VP69t3.jpg
Hi Jomar,
Can you try increasing the priority of your hook? Try 1000 or something higher.
Kindly let us know how it goes.
Hi,
I tried 100 before I ask here. Now I tried 1000 and still the same.
Can you try moving the script:
<script type="text/javascript">
window._taboola = window._taboola || [];
_taboola.push({
mode: 'thumbnails-a',
container: 'taboola-below-article-thumbnails',
placement: 'Below Article Thumbnails',
target_type: 'mix'
});
</script>
to wp_footer? You’ll need to create a new Hook Element from this.
If that doesn’t work, can you reach out to the script creator as to why the issue is occurring?
Kindly let us know how it goes.