rss to blog

 

 

Modifying Word Press Templates

Adding Adsense to All Blog Pages

In order to have adsense on all of your blog pages, including the archived pages.
Adsense needs to be placed in the header.php file
Open these folders: /wp-content/themes/default/

And you will find the header.php file

At the very bottom of this file right before the last <hr/ >

You will add your adsense code.

The adsense panel that is the most effective for me is the 336X280 panel so that is what I use on all of my sites. If you were to add only the adsense code to the header file, then view the page you will notice that the adsense panel is way too far on the left.

So I usually place it in a table. And because adding adsense to the header creates a lot of white space I also add images around the adsense code to fill up the space.

You'll also notice that I've added adsense links to this example. You do not have to do these things. You can simply use one adsense panel with or with images. It is your choice. See my example http://www.bloggingsecrets.info/blog/


<table width="90%" border="0" align="center" cellpadding="0">
<tr>
<td width="80"><img src="http://bloggingsecrets.info/images/busman.jpg" width="80" height="256" /></td>
<td width="367"><script type="text/javascript"><!--
google_ad_client = "pub-XXXXXXXXXXXXXX";
google_ad_width = 336;
google_ad_height = 280;
google_ad_format = "336x280_as";
google_ad_type = "text_image";
google_ad_channel ="XXXXXXXXXXX";
google_color_border = "FFFFFF";
google_color_bg = "FFFFFF";
google_color_link = "000080";
google_color_url = "CCCCCC";
google_color_text = "000000";
//--></script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>&nbsp;</td>
<td width="206" valign="top"><img src="http://bloggingsecrets.info/images/conferencecall5.jpg" width="200" height="143" /><br />
<script type="text/javascript"><!--
google_ad_client = "pub-XXXXXXXXXXX";
google_ad_width = 200;
google_ad_height = 90;
google_ad_format = "200x90_0ads_al_s";
google_ad_channel ="XXXXXXXXXXX";
google_color_border = "FFFFFF";
google_color_bg = "FFFFFF";
google_color_link = "000080";
google_color_url = "CCCCCC";
google_color_text = "000000";
//--></script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></td>
</tr>
</table>


Modifying WP Templates cont'd

Partial Reprint with permission

 

You can also put tower AdSense blocks
in the right-hand column.

To do that find the template named sidebar.php and
place you AdSense immediately beneath this piece of code at
the top of the template:

----------------------------------------------------------
<div id="sidebar">
----------------------------------------------------------

The only thing to watch here is that your AdSense block is
not wider than the sidebar
, as that pushes everything out.

To make sure your central AdSense block gets carried over to
Archive posts, edit the template, archive.php (not
archives.php) in the same way as index.php. WP can't seem to
find the clipart image in archives, so I just make a full
reference to the image in this template.

Of course, it's best to match background colors, link
colors, etc, to your WP blog's colors. That way it blends in
perfectly and looks more like it's an integral and natural
part of the site, and not a glaring ad stuck there in hope
and desperation.

The left-hand sidebar in WP is colored #F9F9F9 and the main
body part if white (#FFFFFF). The link colors in WP are
#0066CC. Use those colors and your AdSense will look more
natural.

If you open up the header.php template you can add your
keyword and content meta tags. I add them just below the
title tag. I find this helps initially to get the AdSense
working right, and not displaying PSAs.

 

If you want your own header image for
your blog, it's quite easy to do.

First make your image, about 740 x 200 pixels. I
find that size works OK. You can name it with your main
keyword if you like, or anything else for that matter.

In Admin go to Options and make sure the Weblog Title and
Tagline fields are saved blank. To make sure your blog
*does* have a title, edit the header.php template and simply
add your title inside the title tags, leaving the rest of
the code in place. That seems to work fine. This is what I
did for the Gifts blog:

-----------------------------------------------------------
<title>Unique Gift Ideas<?php bloginfo('name'); ?> <?php if
( is_single() ) { ?> &raquo; Blog Archive <?php } ?> <?php
wp_title(); ?></title>
-----------------------------------------------------------

Further down the header.php template
you'll find this piece of code:

----------------------------------------------------------
#header { background: url("<?php
bloginfo('stylesheet_directory');
?>/images/kubrickheader.jpg") no-repeat bottom center; }
----------------------------------------------------------

Simply change the image file name, kubrickheader.jpg, to
whatever you named your header image.

Then upload you header image to this folder:
wp-content/themes/default/images/

And if you want to remove that link at the bottom that links
back to WordPress, edit the footer.php template. There's
several other out going links in the sidebar.php template too
that can be removed. They (WP) probably don't want you to do
this, but you don't get struck by bolts of lightning if you
do it.

You can edit all the templates online through

Presentation > Theme Editor.

But the templates have to be writeable - chmod 777, and maybe
that's not such a good idea security wise. You
could make the templates chmod 777, do all the editing, then
change them back to something more secure. I prefer to edit
offline and FTP the templates to the server.

And of course, editing colors, etc, in:
wp-content/themes/default/images/style.css
makes personalization possible. But it can be a lot of trial
and error trying to figure out which bit of code controls
what. You need to keep a backup as little changes can make
big problems if you get it wrong :-)

After that it's just a matter of setting up Michelle's
RSStoBlog software to post to your blog, and smiling all day
long :-)

Anyway, this is what I do, though I'm still experimenting.
Hope it helps.

You can see what I've done here, though this site is still
being developed:
http://www.unique-gift-ideas-1st.com/

By John Coutts

Reprint Rights Not Granted !!

 

 

 
(C) Copyright 2005 RSStoBlog.com