I had pasted an google add sense code in WordPress by following steps:
step 1
login to my dashboard , then I go to appearance tab & select editor option
step 2
after that I go to the theme-functions , a window open having code.
step 3
I go to the last of this window then hit enter and place the add code by google adsense adunit.
Code is:
Function myAddSenseFunction(){
return '<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- header ad -->
<ins class="adsbygoogle"
style="display:inline-block;width:728px;height:90px"
data-ad-client="ca-pub-6517659835455449"
data-ad-slot="7383706018"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>';
}
add_shortcode('addToAppearHere','myAddSenseFunction')
after it i update file
then my word press admin panel did not open. a 500 server error message occurred. please suggest me how to fix this error ? and login to again my dashboard ??
I think your problem is that you wanted to add your google adsense ad unit in your wordpress blog. And when you wanted to place ad in your post.
For that purpose you logged in into your wp-admin dashboard and your changed your theme by adding a function into
function.php
file within the theme-functions option. You must have to put your function (containing ad unit code) at the end of the file and updated it. Then you can use your function name in your post like[functionName]
and that's how you place ad in your wordpress post.
But you messed up your site, and getting 500 server error
its mean function you have added in wordpress file is having a programming error.
That's why you can't even access your wp-admin dashboard, do you also have problem accessing that post in which you added your ad?
And now you want a solution somehow to check that file function.php and resolve that error. And you want your site to not give 500 server error.