How to Add Adsense Link Units in the WicketPixie Topbar


Just yesterday I took a look at my topbar and decided that it was way too bare. I do not have any sites to link off to up there, so I thought I would fit an Adsense link unit in the topbar. It looked so nice, I decided that I must blog about it. Here I will show you how to add Adsense link units in the WicketPixie topbar.

First log in to Adsense and create the link unit, the following works best:

  • A 468×15 unit with either four or five slots.
  • Black background, black border, and white text.

Now, log in to WordPress and click on Editor in the Appearance drop-down. Make sure the file ‘header.php’ is writable by the web server and click on it to edit it. Once the file is loaded in the editor, find the following lines:

<ul>
    <li id="topbar-subscribe"><a href="#">Subscribe</a></li>
    <!--
        <li id="topbar-share"><a href="#">Bookmark/Share</a></li>
    -->
    <?php if (is_user_logged_in()) { ?>
    <li id="topbar-admin"><a rel="nofollow" href="<?php bloginfo('wpurl'); ?>/wp-admin">Admin</a></li>
    <?php } ?></ul>
    <ul>
    <li id="topbar-subscribe"><a href="#">Subscribe</a></li>
    <!--
        <li id="topbar-share"><a href="#">Bookmark/Share</a></li>
    -->
    <?php if (is_user_logged_in()) { ?>
    <li id="topbar-admin"><a rel="nofollow" href="<?php bloginfo('wpurl'); ?>/wp-admin">Admin</a></li>
    <?php } ?>
</ul>

You may already have extra code in there, just make sure that the 468×15 unit will fit between those links and the search box. Now enter the following after the last <li></li> (Replacing _SCRIPT_CODE_ with the Javascript code Adsense provided you):

<li>_SCRIPT_CODE_</li>

That’s it! Now you have a beautiful link unit in your topbar where previously it was empty real estate (assuming you did not remove anything to place the link units there, of course). It might take 10 minutes for the code to start working after you created it in Adsense.
This is worth it. I have noticed more relevant results in link units than my other ads, and now they are right up at the top of the page!

5 Comments

I really hate ads on blogs, it makes them look needy and cluttered :s

This is a godsend; thanks so much for this step by step.

Ads on blogs work if they are relevant. It’s what pays the bills. Ads on TV makes TV look cluttered too, but we put up with them. :)

Very useful information: “How to Add Adsense Link Units in the WicketPixie Topbar”.
Thanks a lot!

This toolbar trick is neat, thanks! Adsense may make a site look a little cluttered, but the reward for the site owner makes up for it.

For adsense to work the best make sure to put your ads from the middle to the top. Some people put it on the bottom and others don’t see it or click it.

Leave a Comment