ClassiCraft not working with Adblock Plus

Discussion in 'ClassiCraft WordPress Theme' started by spottedvarennes, Feb 14, 2015.

Thread Status:
Not open for further replies.
  1. spottedvarennes

    spottedvarennes Member

    Joined:
    Jan 26, 2015
    Messages:
    79
    Likes Received:
    0
    Hi, Classicraft display a blank page when adBLock plus is ON, and when navigating to an AD, I think it block it because of the word AD in the Url. Do you have a solution to change the URL ? To change the word AD by somthing else ?
     
  2. Naveen

    Naveen Guest

    Joined:
    Aug 8, 2014
    Messages:
    1,739
    Likes Received:
    64
    Hey!

    I don't thing so because, Ad Block is installed on my browser too...

    It seems to some plugins are conflicting in your WordPress, please check your plugins,

    Kindly deactivate all plugins and see the result, then activate your plugins one by one by seeing result on each activation...

    Hope you will figure it out..

    Thanks & Regards!
    Naveen Kolhe
    InkThemes.com
     
  3. shyheim

    shyheim Member

    Joined:
    Oct 8, 2013
    Messages:
    60
    Likes Received:
    1
    the problem is "single-ad" on tag body, i put only <body> on header.php and it works
     
  4. spottedvarennes

    spottedvarennes Member

    Joined:
    Jan 26, 2015
    Messages:
    79
    Likes Received:
    0
    Naveen I tested your Live preview, it does the exact same think with adBlock plus enabled
     
  5. spottedvarennes

    spottedvarennes Member

    Joined:
    Jan 26, 2015
    Messages:
    79
    Likes Received:
    0
    Can you explain what you mean ?
     
  6. shyheim

    shyheim Member

    Joined:
    Oct 8, 2013
    Messages:
    60
    Likes Received:
    1
  7. spottedvarennes

    spottedvarennes Member

    Joined:
    Jan 26, 2015
    Messages:
    79
    Likes Received:
    0
    yep you are right, the single ad class trigger the adblock thanks, how you found this ? does adblock told you what it blocked ? mine doesnt tell me what it block
     
  8. shyheim

    shyheim Member

    Joined:
    Oct 8, 2013
    Messages:
    60
    Likes Received:
    1
    i dont remember.. maybe i've found "single-ad" on some adblock's blacklist.. now tell me how to fix my problem.. :D :D :D
     
  9. spottedvarennes

    spottedvarennes Member

    Joined:
    Jan 26, 2015
    Messages:
    79
    Likes Received:
    0
    Thanks you again shyheim you saved me hours of works
     
  10. spottedvarennes

    spottedvarennes Member

    Joined:
    Jan 26, 2015
    Messages:
    79
    Likes Received:
    0
    For the other problem you had, you'll have to change some javascript, and some code in files, kind of hard to tell you exactly what to do, since my solution works on my customization, but yeah I can help you by skype, PM me your skype I'll try to help
     
  11. spottedvarennes

    spottedvarennes Member

    Joined:
    Jan 26, 2015
    Messages:
    79
    Likes Received:
    0
    So to fix this add this function in the functions.php of the theme

    Code:
    function remove_a_body_class($wp_classes) {
       
       
     
          foreach($wp_classes as $key => $value) {
          if ($value == 'single-ad') unset($wp_classes[$key]);
          }
     
    return $wp_classes;
    }
     
    add_filter('body_class', 'remove_a_body_class', 20, 2);
     
    

    This will remove the single-ad class from the body. Everywhere, this class not seem to be used in any css or javascript, so it should be safe to remove. Ill let you know if I found a bug because the single-ad class is removed.
     
  12. shyheim

    shyheim Member

    Joined:
    Oct 8, 2013
    Messages:
    60
    Likes Received:
    1
    mmmmhhh seems doesnt work for me..
     
  13. spottedvarennes

    spottedvarennes Member

    Joined:
    Jan 26, 2015
    Messages:
    79
    Likes Received:
    0

    Hi I updated the code, forgot the filter ;)
     
  14. spottedvarennes

    spottedvarennes Member

    Joined:
    Jan 26, 2015
    Messages:
    79
    Likes Received:
    0
    Please we need confirmation that the single-ad class can be removed from the body class. . I see no css attached to this class, and it trigger Addblock so it should be removed if not used elsewhere in the code. Please see solution I gave for a quick fix
     
  15. shyheim

    shyheim Member

    Joined:
    Oct 8, 2013
    Messages:
    60
    Likes Received:
    1
    yes it works !
    thanks :)
     
Thread Status:
Not open for further replies.

Share This Page