How add adsense code under title wordpress?

Discussion in 'AdSense' started by nabilacute, Jul 27, 2008.

  1. #1
    Where and how add adsense code under title in wordpress ? are i must using ftp or not? :confused:
     
    nabilacute, Jul 27, 2008 IP
  2. itcn

    itcn Well-Known Member

    Messages:
    795
    Likes Received:
    31
    Best Answers:
    0
    Trophy Points:
    118
    #2
    No, you don't need FTP, you can do it by editing the theme. In the Wordpress admin screen, click on Design > Theme Editor. Then click on Main Index Template (index.php). You'll probably see something like:

    
    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    
    <h1><?php the_title(); ?></h1>
    		
    ...
    
    Code (markup):
    Add your adsense code after the "the_title" function - that's the function that draws the page title.
     
    itcn, Jul 27, 2008 IP
  3. nabilacute

    nabilacute Active Member

    Messages:
    619
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    58
    #3
    but in my Wordpress admin screen "You need to make this file writable before you can save your changes. See the Codex for more information"

    i cant modif there. how change that:confused:
     
    nabilacute, Jul 27, 2008 IP
  4. itcn

    itcn Well-Known Member

    Messages:
    795
    Likes Received:
    31
    Best Answers:
    0
    Trophy Points:
    118
    #4
    For that, you need to change write permissions on the template file. If you have shell access to your server, you could just:

    cd wp-content/themes/YOURTHEME
    chown apache.apache *
    chmod 644 *

    Otherwise you'd have to ask your hosting company to set permissions on those files.
     
    itcn, Jul 27, 2008 IP