Script to Post

Posted in: Newspaper
Post count: 33

I need to add the following script to Default and Style 10 Post template. Can you guide me to the correct files to modify?

The code:


Place this code in the <head> section:
<script type="text/javascript">
window._taboola = window._taboola || [];
_taboola.push({article:'auto'});
!function (e, f, u, i) {
if (!document.getElementById(i)){
e.async = 1;
e.src = u;
e.id = i;
f.parentNode.insertBefore(e, f);
}
}(document.createElement('script'),
document.getElementsByTagName('script')[0],
'//cdn.taboola.com/libtrc/tdgcyworldnnewsmediathemasportscom11062518/loader.js',
'tb_loader_script');
</script>

Place this code exactly below the article:
<div id="taboola-sponsored-below-article"></div>
<script type="text/javascript">
window._taboola = window._taboola || [];
_taboola.push({
mode: 'sc-themasports',
container: 'taboola-sponsored-below-article',
placement: 'sponsored Below Article',
target_type: 'mix',
tracking: 'utm_source=projectagora&utm_medium=contentdiscovery'
});
</script>
<div id="taboola-organic-below-article"></div>
<script type="text/javascript">
window._taboola = window._taboola || [];
_taboola.push({
mode: 'organic-themasports',
container: 'taboola-organic-below-article',
placement: 'organic Below Article',
target_type: 'mix',
tracking: 'utm_source=projectagora&utm_medium=contentdiscovery'
});
</script>

Place this code at the end of your <body> tag:
<script type="text/javascript">
window._taboola = window._taboola || [];
_taboola.push({flush: true});
</script>

Post count: 20688

Hi,

Each post template style has a corresponding single and loop single file in the main theme folder – https://www.screencast.com/t/02PVyDno8L There you can see the structure of the post template and you can try placing your code in the file you want. If you need to insert a code in the head section as well, you can find it here – https://www.screencast.com/t/Vr0VyxXeW

Thanks

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