1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

I want to insert Adsense Code In Wordpress

Discussion in 'PHP' started by davidmethew, Nov 9, 2014.

  1. #1
    Dear All,

    I want to insert the Google Adsense code in the Wordpress to show ads, After the title of the post and adfter ad the post content should be not wrapped around the ad. like http://propakistani.pk
    Please help and reply me to achieve this goal, Very warm thanks and regards.
     
    davidmethew, Nov 9, 2014 IP
  2. PoPSiCLe

    PoPSiCLe Illustrious Member

    Messages:
    4,623
    Likes Received:
    725
    Best Answers:
    152
    Trophy Points:
    470
    #2
    There are dozens, if not hundred plugins for this for WP. Why don't you just download one of the adsense-plugins and put the shortcode into the template file? If you don't want to do that, just put the adsense code within a <p> or <div> where you want it, in the template files.
     
    PoPSiCLe, Nov 10, 2014 IP
  3. Mattingley

    Mattingley Greenhorn

    Messages:
    48
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    8
    #3
    That's one method of inserting the ad code, another would be to modify the theme source files and insert it manually. I always insert ad codes manually, as it gives you complete and full control over it, instead of relying on the features/options which a plugin has. Either method will work for what your trying to do though
     
    Mattingley, Nov 10, 2014 IP
  4. PoPSiCLe

    PoPSiCLe Illustrious Member

    Messages:
    4,623
    Likes Received:
    725
    Best Answers:
    152
    Trophy Points:
    470
    #4
    Uhm... as I said in my answer, he could put the code in via a plugin, or via the TEMPLATE files - which are the theme-files...
     
    PoPSiCLe, Nov 10, 2014 IP
  5. Keteki

    Keteki Active Member

    Messages:
    112
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    90
    #5
    Yes PoPSiCLe, for a beginner, plugins will help placing adsense code as per his need and also it saves much time.
     
    Keteki, Nov 10, 2014 IP
  6. davidmethew

    davidmethew Active Member

    Messages:
    368
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    53
    #6
    Then how can I achieve this goal, without plugin, I tried <br> <div> etc but text is still wrapped around the Rectangle box. I want to show

    Title of the post
    AD
    Post Content
     
    davidmethew, Nov 11, 2014 IP
  7. Keteki

    Keteki Active Member

    Messages:
    112
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    90
    #7
    In theme "content.php", find
    the_title( '<h1 class="entry-title">', '</h1>' );
    PHP:
    or its full php phrase, <?php and ?>
    After that, place your adsense code
    <br><br><center>
    <your adsense code>
    </center><br><br>
    HTML:
    or
    <br><br>
    <div style="width:720px;height:90px;">
    <your adsense code>
    </div>
    <br><br>
    HTML:
    It is better, if you use shortcodes
     
    Keteki, Nov 11, 2014 IP
  8. davidmethew

    davidmethew Active Member

    Messages:
    368
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    53
    #8
    I m using WP-Prosperity theme..... There is no such text entry in the content.php
     
    davidmethew, Nov 16, 2014 IP
  9. davidmethew

    davidmethew Active Member

    Messages:
    368
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    53
    #9
    will http://quicksense.net/ be helpful ?
    sample ads as www.learnpakistan.com
     
    davidmethew, Nov 17, 2014 IP
  10. kcitywd

    kcitywd Member

    Messages:
    21
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    31
    #10
    Use this plugin https://wordpress.org/plugins/adsense-plugin/. It creates blocks to display ads on your website.
     
    kcitywd, Dec 6, 2014 IP
  11. pdoley

    pdoley Well-Known Member

    Messages:
    84
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    110
  12. Elena13profi

    Elena13profi Peon

    Messages:
    4
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    1
    #12
    Hello,

    Please clarify where you are trying to insert the code. I mean what file you are trying to edit.
     
    Elena13profi, Dec 10, 2014 IP
  13. Dhiraj Das

    Dhiraj Das Member

    Messages:
    7
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    31
    #13
    Have a look at these advertising management plugin for WordPress http://www.sourcewp.com/best-advertising-management-plugins-for-wordpress/
     
    Dhiraj Das, Feb 23, 2015 IP
  14. dave2013

    dave2013 Well-Known Member

    Messages:
    351
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    120
    #14
    Many times your wordpress theme will have an ad space section if you visit theme options, otherwise add it to the widget section or simply use one of the thousands of plugins designed for this
     
    dave2013, Mar 21, 2015 IP