Left or Right Align your image, adsense code or other advertisement in wordpress
Suppose you want to show your google adsense in the top-left side of your post. If you simply put your adsense code in the single post page (single.php) of wordpress then the text of your post will appear below the adsense.
To solve this problem, I used stylesheet property called ‘margin’. The example below is from single.php file of my wordpress theme. The adsense code is kept in between the
tag. It is kept after
Similarly, I created an about me page. I wanted to show my pic in the top-left position and to show the text by the side of the pic. For this I added style to my uploaded image while editing the page. I went to the HTML (not View) section in the edit/add page. The style I added goes like this: More HTML source from my about page: Popularity: 2% Related posts:
<div class="entry-content">
<p class="alignleft" style="text-align: left; margin: 8px; float: left;">
<script type="text/javascript"><!--
google_ad_client = "pub-8802303964745491";
/* 336x280, created 5/16/08 */
google_ad_slot = "7152897181";
google_ad_width = 336;
google_ad_height = 280;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</p>
<?php the_content(''.__('Read More <span class="meta-nav">»</span>', 'sandbox').''); ?>
style="margin: 8px; float: left;"
<p style="text-align: left;">
<img class="alignleft" alt="Mukesh Image" src="http://blog.chapagain.com.np/wp-content/uploads/close-up-small.jpg" style="margin: 8px; float: left;"/>
</p>
<p> </p>
<p class="MsoNormal" style="text-align: justify;">
Hi, I am Mukesh Chapagain. My rest of the introduction goes here...
</p>

the align code worked perfect for my adsense thanks
Leave your response!