Disable ads in logi...
 
Notifications
Clear all

[Solved] Disable ads in login and register

7 Posts
2 Users
0 Reactions
687 Views
(@melih)
Posts: 14
Eminent Member
Topic starter
 

Hello.

Not sure if you can help me on this. I'm using OsclassWizards theme and it seems that i got a violation email from Google Adsense.

They do not like to show ads in login and register because of "no content" or something.

I tried the suggestions from the official Osclass forum but it doesn't work (or i can't make it to work).

Any help appreciated.

Thanks

 
Posted : August 31, 2019 13:59
Johannes de Sacrobosco
(@johannes-de-sacrobosco)
Posts: 83
Member Moderator
 

How do you show Ads from Adsense ? Using the theme's options or you just put their code manually ?

Or are you using their auto ads (using just their script in the /header) ?

Let me know and i can help more.

 

 
Posted : August 31, 2019 14:11
Johannes de Sacrobosco
(@johannes-de-sacrobosco)
Posts: 83
Member Moderator
 

If you use adsense inside the header.php  (and ONLY that) :

 

<?php if  ( !osc_is_login_page() && !osc_is_register_page() )  { ?> 

your adsense script here

<?php } ?>
 
Posted : August 31, 2019 14:55
Johannes de Sacrobosco
(@johannes-de-sacrobosco)
Posts: 83
Member Moderator
 

If you use the theme's options, change the header.php from:

<?php if( osc_get_preference('header-728x90', 'osclasswizards_theme') !=""){ ?>
<div class="ads_header ads-headers"> <?php echo osc_get_preference('header-728x90', 'osclasswizards_theme'); ?> </div>
<?php } ?>

to:

<?php if ( ( osc_get_preference('header-728x90', 'osclasswizards_theme') !="") && ( !osc_is_login_page() && !osc_is_register_page() )) { ?>

<div class="ads_header ads-headers"> <?php echo osc_get_preference('header-728x90', 'osclasswizards_theme'); ?> </div>

<?php } ?>
 
Posted : August 31, 2019 15:01
(@melih)
Posts: 14
Eminent Member
Topic starter
 

Thanks. I'm using the theme's options. Did the changes in the code.

When i try to Save in theme's forms the scripts from adsense, i get error 403 Denied.

Any ideas ?

 

 
Posted : August 31, 2019 15:37
Johannes de Sacrobosco
(@johannes-de-sacrobosco)
Posts: 83
Member Moderator
 

This comes from your hosting / webserver "mod security". Disable mod security for a while and save again.

Keep in mind that any changes to mod_security takes from 1 to 15 minutes to update.

After saving and testing, REenable mod_security for your domain.

 

 
Posted : August 31, 2019 15:48
(@melih)
Posts: 14
Eminent Member
Topic starter
 

That worked, many thanks.

 

 
Posted : August 31, 2019 16:11