How to add banners to your header or footer in wordpress


Tutorials - Tutorials

User Rating: / 0

Adding banners to your footer or header depends on the theme you're using. If it has widget area added to its footer or header, you can follow the instructions in the first part of this tutorial for adding banners to the sidebar.

On the other hand, if your theme does not have widget areas added to the footer/header areas, you need to add your banners manually. To do this login to your WordPress admin page and go to Appearance -> Editor. For the purpose of this tutorial, we will add a custom SiteGround banner to your header. Since we will add the banner to the header of the site, select header.php from the list of files available for edit. 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.

First, find the opening of the body tag. In the twenty-twelve default WordPress theme it looks like this:

<body <?php body_class(); ?>>

Right after this add the following code:

<div><a href="/BANNERLINK" target="_blank"><img src="/LINKTOIMAGE" width="200" height="50" /></a></div>

You need to replace BANNERLINK and LINKTOIMAGE with the URL where you want the banner to point to and the link to the banner image. Finally, replace the width and height parameters with the actual dimensions of the banner image.

This code will render your banner on top of your site. Note that depending on the theme you're using, you may need to move the code in order to place it wherever you want.

Note that we wrapped the banner into a div element. We did this because we want to style this banner further. To do this, select style.css from the right column and when the page refreshes, add the following lines:

.headerbanner { display:block; margin: 10px auto; width: 480px}

This will center the banner and add some top margin making it look much better. Of course, this is just an example - you can use the full power of CSS in order to style the banner the way you want it.

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

About Us

Royal Developer Top three Web Designing and Web Development Company in Dehradun, Uttarakhand, India. Royal Developer Best SEO Company in Dehradun takes pride in its philosophy of 'Employee First' which empowers to create a real value for the customers. Royal Developer can offer Best and cheap Website Development Software Development & SEO Services. We are the Best service Provider of SEO, SEM, SMO Services Company in Uttarakhand. Web Designing Course in Dehradun, Web Designing Classes in Dehradun, Web Design Training Institute in Dehradun, Web designing institute in dehradun, Best institute for web designing in dehradun, Web development training in dehradun, Web development course in dehradun, Web Designing Training in Dehradun.


- Contact Information - 

Add : RDIT Services Pvt Ltd, 3rd Floor, RGM Plaza, Above Chandu Canteen,
          23 Chakrata Road, Dehradun - 248001, Uttarakhand, India

Email : 


 : +91 8171200108, +91 8979462451,
                                  +91 7895753921

Quick Enquiry Form

Enter your full name

Enter your valid email address

Enter your correct mobile number

Invalid Input

Your Message
Invalid Input

Enter Code
Enter Code
  RefreshInvalid Input


You are here: Home Tutorials How to add banners to your header or footer in wordpress