Thesis: Adding an ad into the header

by Layne Heiny on October 25, 2009

I switched Technology Questions over to WordPress last week. This week, I started to work on cleaning up the theme. During my research, I ran across several people asking how to add an ad to a Thesis header and a tutorial. After trying several different suggestions, I modified code found on the Thesis support forum.

Code for the custom.css was changed to relative position (rather than absolute). I also had to use negative px position. Maybe there is an easier way and you’ll share it with everyone. For now, here is the custom.css code.

/* Ad in Header - relative */
.custom #leaderboard_ad { float: right; position: relative; width: 468px; height: 60px; top: -80px; left:-20px;}

Code for custom_function.php

function header_ad() { ?>
<div id="leaderboard_ad">
INSERT TRIBAL FUSION SCRIPT OR BURSTMEDIA OR .... HERE ....
</div>
<?php }
add_action('thesis_hook_header', 'header_ad');

When you are done, you should see a 468 x 60 banner in your customized header as shown below:

Go ahead and give it a try. Don’t forget to let me know how things work for you.

This website uses IntenseDebate comments, but they are not currently loaded because either your browser doesn't support JavaScript, or they didn't load fast enough.

Previous post: Windows 7 launch event full of touching

Next post: Google Revenue Up But AdSense Publisher Revenues Are Down