Latest Post
Showing posts with label Blogger. Show all posts
Showing posts with label Blogger. Show all posts

Exclude Adsense ads from appearing in blog entries or certain pages

Although the best way to take advantage of AdSense ads is to put AdSense ads in all publications and pages on your website. 
Put Google Adsense Ads Inside Blogger Posts

But sometimes you need to prevent AdSense ads from appearing identify a specific page or private from your blog for one reason or another
Only a total of simple codes will solve this problem.

First  Control of ads listed in the Post :

1 - Control Panel Blogger, go to the tab: (template), and (HTML editor).
2 - Look for ads Adsense code, and place it between the following code:

    <div id="GAdsense1">
    The code of Adsense ads average

    </div>
    3 - now directed to the tab (posts), and from it to any blog post you wish to hide  Adsense ads, and click (Edit).

    4 - HTML editing mode, go to the last lines of code, and add the following code after then  press (update):

    <script type="text/javascript">
    var Ads1 = document.getElementById('GAdsense1');
    Ads1.parentNode.removeChild(Ads1);
    </script>
    Now we have to prevent Adsense ads from appearing on this post.
    The ads will appear on all Posts normally.

     Note
    These codes can be applied on the pages of Entries or Static Pages.
    These codes can be applied to any type of ads (text - pictures - links)


    Second  Control of ads listed In Widget

    That you have a number of Adsense ad units on Widgets, anywhere.
    You can also prevent the emergence it of certain pages using the following steps:

    1 - Go To  Blogger Control Panel, go to the tab (Layout).

    2- Hover your mouse on the word Edit at the bottom of the Widget you want to exclude his appearance, and see the bottom of the browser bar to know the number Widget, and be on the body (HTML9), for example, as shown in the picture below

     3 - now directed Tab (​​template), and it (Edit HTML).

     4 - button (Jump To Widget), select the number of the Widget.



    5 - you'll find your code like this ( Replace 5 with your Widget number):

    <b:widget id='HTML5' locked='false' title='' type='html'>
    <b:includable id='main'>
    Codes belonging To Widget
    </b:includable>
    </b:widget> 
    6-Change the code to become like this 
    <b:widget id='HTML5' locked='false' title='' type='html'>
    <b:includable id='main'>
    <b:if cond='Condition'>
    Codes belonging To Widget
    </b:if>
    </b:includable>
    </b:widget>
    7 - Now replaced  the word "Condition"  with any of the following lines in accordance with  the required condition for the emergence of advertising:

    •  To appear only on the home page:
    data:blog.url == data:blog.homepageUrl

    •   To appearing on all pages except the Home:
    data:blog.url != data:blog.homepageUrl

    •  To appear only on the pages of posts :
    data:blog.pageType == "item"

    •  To appearing on all pages except pages Postings:
    data:blog.pageType != "item"

    • To appearing on static pages only:
     data:blog.pageType == "static_page"

    • To appearing on all pages except static pages:
     data:blog.pageType != "static_page"

    •  To appear on a particular link in the blog:
     data:blog.url == " Put the Link here "

    •  To appearing on all pages except a particular link in the blog:
     data:blog.url != "Put the Link here"
     Note

    The codes previous can be used with any Widget whether the ads contain Adsense or anything else.
     

    How to Put Google Adsense Ads Inside Blogger Posts

     



    In this post i will show you how to put Google Adsense Ads inside your post in Blogger or Website.

    With this method you can put Adsense declaration at any place inside the Post.

    You can now put your ad in the paragraphs on the right or the left  
    or the middle .



    Before Making any changes to your Blog/Website, make sure to Backup Your Blogger Template.
      


    Steps to Place AdSense Ads inside Blogger Posts

    -Go to your Google Adsense account and chose the type of advertising you want.
    -Before you use Adsense code, you must convert it .To convert the code you need to go to Html Converter from  here  and paste the code below and press the convert and copy new code .
    -your Adsense code now ready .
      
    -Now we will put Adsense code into the template, but do not forget to take a backup copy of the template to avoid any error.





    Click on the image to see it full size
    - Now go to Template –> Edit HTML –>and click " ctrl+f " In side  the template .


    Now search for this code

    <data:post.body/>
    • REPLACE the Code <data:post.body/> with the Following Code:
    <div expr:id='"aim1" + data:post.id'></div>
    <div style="clear:both; margin:10px 0">
    PUT YOUR PARSED ADSENSE CODE HERE </div>
    <div expr:id='"aim2" + data:post.id'>
    <data:post.body/>
    </div>
    <script type="text/javascript">
    var obj0=document.getElementById("aim1<data:post.id/>");
    var obj1=document.getElementById("aim2<data:post.id/>");
    var s=obj1.innerHTML;
    var r=s.search(/\x3C!-- adsense --\x3E/igm);
    if(r>0) {obj0.innerHTML=s.substr(0,r);obj1.innerHTML=s.substr(r+16);}
    </script>
    Do not forget to delete the words in red and put its place code converter for Adsense.

    Note: Some templates contain more than one <data:post.body/> code , To solve this problem, replaced them all with the above code.

    -Now click "Save Template " .

    In Order To place the Ad in any part of your blog post, Simply place the following piece of code in your post in the exact place you want the Ad to appear.
       
    <!-- adsense -->
    [Note: Place the above piece of code on the HTML of the Post.]

    Now place the <!-- adsense --> anywhere you want to show ads in the your post .

    Waiting for your comments
    Thank you for all
     
     
     
    Support : Creating Website | Johny Template | Google World
    Copyright © 2011. SOFTWARE RAR - All Rights Reserved
    Template Created by Creating Website Published by Google World
    Proudly powered by Blogger