Tutorial Introduction

Advertisements are essential for most websites on the Internet. In this tutorial we will explain how to add banners to different parts of your site. Most of the websites that offer banners/affiliation will provide you with the entire banner code so all you have to do is choose where you want to place the banner and follow the instructions below.

Sidebar Banners

It is common practice to use your sidebar to add banners. There are two ways to do this – if your theme supports widgets in your sidebar, you can add a Text widget with your banner code in it, or you can add the code directly to the sidebar.php file of your theme. You can edit the .php file from the Appearance / Editor part of your WordPress admin dashboard.

If your not experienced with modifying the core template files then you can use widgets.


From your WP-Admin navigate to Appearance / Widgets and drag a Text widget to the appropriate widget area. In our case that would be “Interactive Sidebar”.


Now, paste the banner code in it, set a title for the widget (optional) and hit the Save button. This will place the banner you want into the sidebar of your WordPress site. This will appear everywhere on your site.

Single Post or Page

If you want to add a banner into the body of your post or page, simply open the Text mode of the WordPress editor and paste the banner code at the top of the post. You can use the WordPress WYSIWYG editor in order to reposition or align the banner in order to make it look with the rest of your post or page.


Above or below all posts or pages

To add banners above or below all your posts or pages, you need to add the banner code inside the single.php or page.php files of your WordPress theme. Both files have similar content but they handle different parts of your site. You can edit those files by logging to your WordPress dashboard and going to Appearance / Editor.


If you want to add the banner above your posts and pages, locate the following code:

<?php while ( have_posts() ) : the_post(); ?>

Below that add the code of your banner. This will add your banner above the all of your page and post titles. Of course, you can add CSS styling in order to make it look according to your needs.

Add banners to your header or footer

Adding banners to your footer or header depends on the theme you’re using. If it has widgetised area added to its footer or header then you can follow the instructions for adding banners to the sidebar, but instead on putting the text into the sidebar area choose the header or footer location and click save. If your theme does not have widget areas added to the footer/header then you need to add your banners manually.

To do this login to your WordPress dashboard and go to Appearance / Editor. If you plan to add the banner to the header of the site, select header.php from the list of files available for edit.


Adding a banner to the footer is basically the same with one small difference – you need to open the footer.php file instead of header.php. All you need to do is paste the code where you want to display the banner.

Note that the code inside this file will be different depending on your theme. You need very basic HTML skills in order to add this banner.

Use plugins to show banners

If you want to display more than one banner on a page, track the ads you show, and more advanced functionality, it is advisable to use one of the available WordPress plugins for banner management.


Since it depends on your particular theme and needs, we suggest that you browse through the banner plugins in the WordPress Plugins Directory in order to find the extension that will best fit your needs. Make a note of the reviews and when the plugin developer last updated the plugin.

Premium Support
If you’re not confident with HTML and WordPress Plugins then we can do the hard work for you. Please contact us for more details about our managed services.