custom code change newspaper 9

Posted in: Newspaper
Post count: 40

Hi,

I wrote custom code within the custom javascript section on my Newspaper 9 themed-website to create a script that executes a function and when I made the update to 9, that script was no longer executed. Is custom code being read differently in this theme update? do you have any advice on how to make this script run?

This is currently what I have:

if (window.location.pathname === “/”) {
var div = document.createElement(“div”);
div.setAttribute(“id”, “tpd-native-ad-d”);

var s = document.createElement(‘script’);
s.setAttribute(‘type’, ‘text/javascript’);
s.innerText = “googletag.cmd.push( function() {googletag.display( ‘tpd-native-ad-d’);} );”

div.appendChild(s);
var block = document.querySelectorAll(‘div[data-td-block-uid^=”td_uid_7″]’);
if (block && block.length > 0) {
var elem = block[0].getElementsByClassName(‘td_module_6’);
}
if (elem && elem.length > 1) {
elem[1].appendChild(div);
console.log(‘adding style’);
}

Thanks!

Post count: 20688

Hi,

There were no changes made to the custom code sections in the last updates. Valid code will work same as before.
That code seems broken however – https://www.screencast.com/t/f3dRLkoUl0E
All that section does is to output the code you enter, it will not be modified in any way, so if it’s valid it will work.

Thanks

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