{"id":1440,"date":"2009-10-18T23:16:03","date_gmt":"2009-10-19T04:16:03","guid":{"rendered":"http:\/\/www.stephenpickering.com\/?p=1440"},"modified":"2010-08-27T15:54:35","modified_gmt":"2010-08-27T20:54:35","slug":"how-to-position-an-adsense-ad-within-a-widget","status":"publish","type":"post","link":"https:\/\/stephenpickering.com\/wordpress\/2009\/10\/18\/how-to-position-an-adsense-ad-within-a-widget\/","title":{"rendered":"How to Position An Adsense Ad within a Widget"},"content":{"rendered":"<div>\n<div style=\"float: left; margin-right: 7px; margin-top: -20px;\">\n<script type=\"text\/javascript\"><!--\ngoogle_ad_client = \"pub-9460716267036836\";\n\/* 336x280, MiddleContent *\/\ngoogle_ad_slot = \"1959614333\";\ngoogle_ad_width = 336;\ngoogle_ad_height = 280;\n\/\/-->\n<\/script><br \/>\n<script type=\"text\/javascript\"\nsrc=\"http:\/\/pagead2.googlesyndication.com\/pagead\/show_ads.js\">\n<\/script><\/div>\n<p>So yesterday I was experimenting with some new themes and found <a href=\"http:\/\/www.dkszone.net\/2009\/08\/eximius-free-3-column-wordpress-theme.html\">one<\/a> I liked that utilized those tall, thin &#8220;Skyscraper&#8221; Adsense ads. It had a left sidebar which I was looking for because I thought I read somewhere that the left side of the page is better on Google&#8217;s <a href=\"https:\/\/www.google.com\/adsense\/support\/bin\/answer.py?hl=en&amp;answer=17954\">&#8220;heat map.&#8221;<\/a> And then I read somewhere else that the right side was better. So who knows? Do you know?<\/p>\n<p>Well anyway the only problem was that the side bar was a lot wider than the ad, and simply inserting the Adsense code made the ad show up to the far left of the sidebar. It didn&#8217;t look right or appealing. So I googled. Right? What did I google?<\/p>\n<ul>\n<li>How to position &#8220;and&#8221; adsense ad within a widget<\/li>\n<li>How to position an adsense ad within a widget<\/li>\n<li>How to position a java script<\/li>\n<li>How to position a Java script Adsense Code<\/li>\n<\/ul>\n<p>That last one did the trick. About the third result brought me to <a href=\"http:\/\/www.wmtips.com\/adsense\/how-insert-adsense-chitika-javascript-code.htm\">this page<\/a> where I found the simple answer, although it&#8217;s a little bit down the page and I had to read a bunch of gobledy-goo techno stuff I didn&#8217;t understand first.<\/p>\n<p>But the simple answer is using the DIV tag like so:<\/p>\n<p><strong><span style=\"color: #000080;\">&lt;div style=&#8221;float: right; margin: 10px;&#8221;&gt;<\/span><\/strong><br \/>\n(<span style=\"color: #800000;\">Insert Adsense Code Here<\/span>)<br \/>\n<strong><span style=\"color: #000080;\"> &lt;\/div&gt;<\/span><\/strong><\/p>\n<p>Then you tweak it how you like. For instance that exact code moved my ad too far to the right, and I had to tweak my margin to 35px to center it. But you get the picture. However I had to deactivate the theme. I don&#8217;t know if there is some bad code in it, or if my servers were just having a problem because my pages suddenly were taking minutes to load, and it was the same for trying to work within the WordPress console itself. Too bad. It was a nice looking theme. Maybe I&#8217;ll try it again to see whether it was my servers or not.<\/p>\n<p>Anyway hope that helps. As far as top and bottom positioning, I don&#8217;t know. Do you know? I would guess you would use the DIV tag again and some kind of Top or bottom float assignment to it. Just guessing. Of course if I ever need that, I can just Google, right? There&#8217;s no need for instruction manuals anymore. Google is the instruction manual. Save the paper. Apple does.<\/p>\n<\/div>\n<p><script type=\"text\/javascript\">\/\/ <![CDATA[\n  google_ad_client = \"pub-9460716267036836\"; \/* 728x90, LeaderboardTxtandImage *\/ google_ad_slot = \"4176597970\"; google_ad_width = 728; google_ad_height = 90;\n\/\/ ]]><\/script><br \/>\n<script src=\"http:\/\/pagead2.googlesyndication.com\/pagead\/show_ads.js\" type=\"text\/javascript\">\n<\/script><br \/>\nCredit goes to Max Bulber and <a href=\"http:\/\/www.wmtips.com\/\">WMtips.com<\/a> for this one. Thanks Max. I just bookmarked you in Delicious.<\/p>\n<pre>Credit: <a href=\"http:\/\/www.wmtips.com\/adsense\/how-insert-adsense-chitika-javascript-code.htm\">http:\/\/www.wmtips.com\/adsense\/how-insert-adsense-chitika-javascript-code.htm<\/a><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>So yesterday I was experimenting with some new themes and found one I liked that utilized those tall, thin &#8220;Skyscraper&#8221; Adsense ads. It had a left sidebar which I was looking for because I thought I read somewhere that the &hellip; <a href=\"https:\/\/stephenpickering.com\/wordpress\/2009\/10\/18\/how-to-position-an-adsense-ad-within-a-widget\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[92,20],"tags":[],"class_list":["post-1440","post","type-post","status-publish","format-standard","hentry","category-blogging-tech","category-tech"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/stephenpickering.com\/wordpress\/wp-json\/wp\/v2\/posts\/1440","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/stephenpickering.com\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/stephenpickering.com\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/stephenpickering.com\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/stephenpickering.com\/wordpress\/wp-json\/wp\/v2\/comments?post=1440"}],"version-history":[{"count":0,"href":"https:\/\/stephenpickering.com\/wordpress\/wp-json\/wp\/v2\/posts\/1440\/revisions"}],"wp:attachment":[{"href":"https:\/\/stephenpickering.com\/wordpress\/wp-json\/wp\/v2\/media?parent=1440"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/stephenpickering.com\/wordpress\/wp-json\/wp\/v2\/categories?post=1440"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/stephenpickering.com\/wordpress\/wp-json\/wp\/v2\/tags?post=1440"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}