How To add banner ads in header of thesis WordPress theme

  • Login to your WordPress admin panel and move over to thesis section and click custom file editor.

  • On the next screen select custom_functions.php from the drop down menu and click on edit selected file.
  • Add the following code in your custom_functions.php and click on save button ( Remember before editing thesis custom_function.php file take a complete backup of the custom_functions.php file via any FTP client Make sure you insert the code very precisely, else it may crash or lay down your website )

[php]/* Thesis header ad tutorial from LineToWeb */

function thesis_header_ad() {
?>

The above code is for custom banner ads for thesis header if you are using Google adsense then you can use the below code instead of using the above one.[php]/* Thesis header ad tutorial from LineToWeb */

function thesis_header_ad() {
?>

  • Just erase the PLACE YOUR GOOGLE ADSENSE CODE HERE text and add your own adsense code and save the custom_function.php you can see a screenshot as shown below of my custom header ads in thesis.
  • You can add any type of header ads like 728*90 or 468*60 the only thing is you should configure the looks in custom.css file. Go to your WordPress admin panel move over to thesis section and click on custom file editor and add the following code into custom.css and save it ( Remember before editing thesis custom.css file take a complete backup of the file via any FTP client )

    [php]/* Header ads 728*90 ad */

    .custom #header #banner_ad {
    float:right;
    margin-top:-12em;
    width:750px;
    padding-left:1em;
    }[/php]

    Just change the custom.css file to place the ads at proper place according to your site’s needs.

    Do let us know if you face any problem while adding a custom banner ads on thesis WordPress theme at the header of your site.