• Home
  • About
  • Web Design
  • Web Hosting
  • SEO & Marketing
  • Tools & Tips
    • Email
      • Reporting Spam Email
    • Security
      • Free Security Tools
    • Dropbox
      • What is Dropbox?
        • Using Dropbox as a File Server
    • Google
      • Creating a Google Account
      • Adding a Review to Google
    • Andover Marketing
      • List Your Andover Event
      • Free Ad Sites for Andover
    • WordPress Tips
      • Shortcodes
      • Google Translate
      • Contact Form 7
  • News & Blog
  • Contact Us
  • February 23, 2012

Web design and SEO from Andover IT

Web design Andover | Andover web design | SEO, Marketing & Hosting

Shortcodes

September 11, 2011 by Andover IT Leave a Comment

How To Add A Banner Ad Quickly To Posts & Pages

  1. Create your required banner ad (we’ll call it “bannerad.gif”)
  2. Upload it to the required directory (we’ll use root/images)
  3. Add the following code to the functions.php page

// Shortcode for bannerad

function bannerAd() {
return ‘<a href=”/pagetogoto/” title=”This is the help text”><img src=”/images/bannerad.gif”></a>’;
}
add_shortcode(‘bannerad’, ‘bannerAd’);

That’s it – done. Now all you need to do in order to add a copy of the ad with the link already setup is to add the following: [bannerad]

The part of the code that controls where it goes to is “/pagetogoto/” and this can be amended to any page or even an external website.

If you’re unsure about setting this up, email us with (a) the name of the file, (b) the folder the file is in and (c) where the link needs to go, and we’ll send over some code to help.

Search The Site

Recent Posts

  • Pantless Weasel – Dilberts SEO Expert
  • Site Launched – The Man With A Van Swindon
  • Shop Site Launched – JCB Workwear Specialists
  • Zeberpupin Now At #1 on Google
  • Zeberpupin – Dilbert’s New Computer System
  • Ironing Service in Andover
  • Oobafit Doing Oobawell

Categories

  • Blog
  • Marketing
  • News
  • SEO
  • Showcase
  • The Website
  • Tips & Advice
  • Website Tips

Return to top of page

Copyright © 2012 · Web design & SEO by Andover IT · Log in