WordPress – display ADS on your sidebar v5
Version: 4.1
Revision: 34 Build 22
Wordpress – display ADS on your sidebar v5
Introduction: this project was driving insane, as I was force re-write my entire “125 pixel ADS” script, just to accommodate new features for my site and for the public to try. However, this version is not JavaScript, instead, it was written in PHP with CSS to align tables and images. So, there you go… Enjoy!
Anyway, all you need to do is follow the instruction, carefully!
1.] Login to your Cpanel and look for your theme folder.
Directory: /wp-content/themes/* costume – theme – folder/…
2.] Look for your “header.php” file and add this line.
<script type="text/javascript" src="<?php bloginfo('template_directory'); ?>/css/blocked_template.css"></script>
Notes: if you saved the file with a different name, you must modify the CSS directory.
If you don’t, your sidebar will go funny…
/* --- Copy these code into your 'blocked_template.css' --- */
#sidebar li li.ad1 {
float:left;
margin: 0 5px 5px 0;
width:125px;
}
#sidebar li li.ad2 {
float:left;
margin: 0 0 5px 0;
width:125px;
}
#sidebar li li.ad3 {
float:left;
margin: 0 5px 0 0;
width:125px;
}
#sidebar li li.ad4 {
float:left;
margin: 0 0 0 0;
width:125px;
}
/* --- Copy these code into your 'blocked_template.css' --- */
3.] Back into your server, you’ll need to create a new “template.php” file. Just give it a simple name, like: ‘ads125.php’. After that, you’ll need to edit your file and add these code with your prefered ADS.
Notes: you’ll need to create a seperate directory (costume stylesheet directory) for your image-banners. The directory is called: ‘banner_images’.
<ul class="banner125 clearfix">
<li class="ad1">
<a href="<?php bloginfo('url'); ?>"><img src="<?php bloginfo('template_directory'); ?>/banner_images/ads125.gif" style="display:block;margin:0;padding:0;" alt="125x125 banner ad" /></a>
</li>
<li class="ad2">
<a href="<?php bloginfo('url'); ?>"><img src="<?php bloginfo('template_directory'); ?>/banner_images/ads125.gif" style="display:block;margin:0;padding:0;" alt="125x125 banner ad" /></a>
</li>
<li class="ad3">
<a href="<?php bloginfo('url'); ?>"><img src="<?php bloginfo('template_directory'); ?>/banner_images/ads125.gif" style="display:block;margin:0;padding:0;" alt="125x125 banner ad" /></a>
</li>
<li class="ad4">
<a href="<?php bloginfo('url'); ?>"><img src="<?php bloginfo('template_directory'); ?>/banner_images/ads125.gif" style="display:block;margin:0;padding:0;" alt="125x125 banner ad" /></a>
</li>
</ul>
4.] Save your progress and add this line into yout “sidebar.php”. But, you must place this ‘ads125.php’ file in the same directory as your “sidebar.php”.
<li> <?php include (TEMPLATEPATH . '/ads125.php'); ?> </li>
5.] You’re good to go!
Copyrighted By Lair360


