Coffeywebdev Posted October 4, 2014 Share Posted October 4, 2014 (edited) I have a Google Adsense code that I am saving to the wp_options table. I can successfully save and retrieve the variable containing the google adsense code but it doesn't do anything except display it as plain text on screen. How can I make this html/javascript in the variable actually load in page as HTML/JS instead of as plain text??? this is the example of the code that I'm saving to the database and retrieving.... <script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script> <!-- EggSquat main banner ad --> <ins class="adsbygoogle" style="display:inline-block;width:728px;height:90px" data-ad-client="ca-pub-XXXXXXXXXXXXXXXX" data-ad-slot="XXXXXXXX"></ins> <script> (adsbygoogle = window.adsbygoogle || []).push({}); </script> ....... may I should make a custom post type and just display a post, and use that instead of a single field saving to database Edited October 4, 2014 by Coffeywebdev Quote Link to comment https://forums.phpfreaks.com/topic/291441-saving-google-adsense-code-in-php-variable-for-reuse-throughout-site/ Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.