Plugin showing error and slowing the site.
-
Hi Sir,
I have tried to use this plugin but unfortunately it is showing some errors at my site. I used following code (replace with my adsense code) through PHP code in Ad Inserter plugin:
<?php
if( aicp_can_see_ads() ) {
$adCode = ‘<div class=”aicp”>
<script async src=”//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js”></script>
<!– AdSense Responsive Ad Code –>
<ins class=”adsbygoogle”
style=”display:block”
data-ad-client=”ca-pub-1234567890″
data-ad-slot=”0987654321″
data-ad-format=”auto”>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
</div>’;
echo $adCode;
} else {
echo ‘<div class=”error”>You have been blocked from seeing ads.</div>’;
}
?>But here it is showing following error:
PHP error in Ad Inserter code block – 11 – …..
Parse error: syntax error, unexpected ‘class’ (T_CLASS), expecting, “,” or “;”When I changed:
echo ‘<div class=”error”>You have been blocked from seeing ads.</div>’;
with:
echo “Sorry! you are blocked from seeing the ads.”;It is not working and takes about 1-2 mints to load the page but still showing ad.
Kindly guide me where I am doing wrong.
Regards,
Chetan
- The topic ‘Plugin showing error and slowing the site.’ is closed to new replies.