How To Add A Banner Ad Quickly To Posts & Pages
- Create your required banner ad (we’ll call it “bannerad.gif”)
- Upload it to the required directory (we’ll use root/images)
- 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.