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.

How can I place adsense in functions.php??

Discussion in 'WordPress' started by alana13, Jul 26, 2009.

  1. #1
    Hi All,

    I recently download a free wordpress theme http://newwpthemes.com/wordpress-theme/just-news/

    Problem is, when i am trying to put adsense code in functions.php the code gets totally messed up and showing errors.

    Can anyone suggest me how can i solve this problem??

    Thanks
    Alana
     
    alana13, Jul 26, 2009 IP
  2. Designstrike

    Designstrike Peon

    Messages:
    110
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Why are you trying to put adsense in functions.php? Thats if you want to enable a theme options page (and you have to have knowledge of how to code it). I reccoment inserting the ad code within idex.php, sidebar.php or single.php. Other than that, there are tons of nifty adsense plugins that you can use. I recommend using a plugin.
     
    Designstrike, Jul 27, 2009 IP
  3. alana13

    alana13 Well-Known Member

    Messages:
    331
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    105
    #3
    Thanks for your reply Designstrike

    I want to use 468x60 header banner and 125x125 banners for adsense. If i install adsense plugin then how can i place adsense code there?
     
    alana13, Jul 27, 2009 IP
  4. pipes

    pipes Prominent Member

    Messages:
    12,766
    Likes Received:
    958
    Best Answers:
    0
    Trophy Points:
    360
    #4
    You definately dont place adsense code in functions.php, you should be placing it in index.php or sidebar.php or something like that, if you're using a plugin for adsense then there should be somewhere that it explains where you place the code for it to appear where you want.
     
    pipes, Jul 27, 2009 IP
  5. freelancer07

    freelancer07 Peon

    Messages:
    142
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #5
    If you want to place banner on top of your site try to find file header.php and add the code there. I have also checked with the developer of this theme there is someone else complaining about the same problem. A new version is uploaded try to download again and make the changes in header.php file
     
    freelancer07, Jul 29, 2009 IP
  6. Designstrike

    Designstrike Peon

    Messages:
    110
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #6
    For most plugins you have automated options for creating and managing your adsense ads. And you upload the ads to your webpage trough widges (for most cases). Be shure to have the pub-id code, almost all of them need it.
     
    Designstrike, Jul 29, 2009 IP
  7. vrktech

    vrktech Well-Known Member

    Messages:
    449
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    108
    #7
    Don't edit functions.php, there is nothing to do with functions.php to place adsense ads

    You can install the plugin "adsense manager" and add the code "<?php adsensem_ad('YOURADNAME'); ?>" whereever you want

    so, if you want ad show in header, edit header.php
    if you want ads (ex: 125x125) in sidebar, edit sidebar.php and so on

    Hope this helps you.
     
    vrktech, Jul 30, 2009 IP