Newspaper 9.7.2 ads problem

Posted in: Newspaper
Post count: 11

When i input adsense in the theme panel, it automatically ads the code below.

if ( td_screen_width >= 1140 ) {
/* large monitors */
document.write(‘<div class=”td-block-title-wrap”><h4 class=”block-title td-block-title”><span class=”td-pulldown-size”>Διαφημίσεις</span></h4></div><ins class=”adsbygoogle” style=”display:inline-block;width:300px;height:250px” data-ad-client=”pub-******” data-ad-slot=””></ins>’);
(adsbygoogle = window.adsbygoogle || []).push({});
}

The document write command conflicts with a gdpr plugin that i have. Can we disable the automatic screen sizing by default? Basically remove the document.write command and the checking for screen sizes.

Post count: 35449

Hi,

As I know this should not be inserted from the theme code -> https://i.imgur.com/wcJJbse.png it should be from the ad code, but to be sure about this I need to inspect one of your ads on your website, please proved me a link to you website to can do this.

Thank you!

Post count: 11

The site is agnostoi.gr and the functionality i am mentioning caused me trouble with the gdpr plugin i am using.
Currently i got the adsense code in the widgets area for the sidebar and had to remove it from the admin panel (article bottom and sidebar) that i had it.

Basically it was loading the sidebar ads that was put through the theme admin panel.

My thoughts were that it was from the adsense ads. that your theme says automatically recognises along with the toggles for the screens thats on the page of every ad (sidebar, article top etc)

The sourcecode in question is the following

var td_screen_width = window.innerWidth;

                    if ( td_screen_width >= 1140 ) {
                        /* large monitors */
                        document.write('<div class="td-block-title-wrap"><h4 class="block-title td-block-title"><span class="td-pulldown-size">Διαφημίσεις</span></h4></div><ins class="adsbygoogle" style="display:inline-block;width:300px;height:250px" data-ad-client="pub-***" data-ad-slot=""></ins>');
                        (adsbygoogle = window.adsbygoogle || []).push({});
                    }
            
	                    if ( td_screen_width >= 1019  && td_screen_width < 1140 ) {
	                        /* landscape tablets */
                        document.write('<div class="td-block-title-wrap"><h4 class="block-title td-block-title"><span class="td-pulldown-size">Διαφημίσεις</span></h4></div><ins class="adsbygoogle" style="display:inline-block;width:300px;height:250px" data-ad-client="pub-***" data-ad-slot=""></ins>');
	                        (adsbygoogle = window.adsbygoogle || []).push({});
	                    }
	                
                    if ( td_screen_width >= 768  && td_screen_width < 1019 ) {....

ty

Post count: 35449

Hi,

I just checked your homepage, category page and few posts, but I didn’t find the code above.

Also if the ads were set in theme panel and you are using standard templates, not cloud, the ads should be displayed on posts, header…

Make sure that you do not have a plugin conflict, please deactivate ALL plugins except tagDiv plugins, also if you are using child theme or cache plugin, deactivate them, clear all cache and try again.

If I do not understand correctly, please provide some more details.

Thank you!

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