This is a guest post by Tung who blogs at TechSharing. If you would like to write for ShoutMeLoud, check our guest posting guidelines.
Do you want to boost your affiliate sales? I think all bloggers want to increasing their money. There are some good spot in your blog and After Post seems to the most profitable spot to place your ads.
Affiliate Ad Box was introduced in DIYThemes. But this tutorial has one disadvantaged,that if we need to change affiliates,we need to modify custom_functions.php file. Editing this file isn’t good because we can get some errors if don’t carefully.
Avoiding this problem is very easy, placing affiliate code in one file and upload to your server.When you need to change affiliate box, just change content in this file.
Let me show you how to do it:
Step 1: Insert the code below into your custom_functions.php file in your Thesis/Genesis theme and or functions.php file if you are using regular themes
// Affiliate Ad Box
function after_post_ad() {
if (is_single()) {
?>
<?php include("http:/yourdomain.com/ad_box.php"); ?>
<?php
}
}
add_action('thesis_hook_after_post', 'after_post_ad');
ad_box.php (http://yourdomain.com/ad_box.php) is file that contains your own affiliate code.
Example: http://techsharing.net/ad_box.php
Step 2: Insert the code below into your custom.css file or style.css file and save:
/*---:[ after post ad ]:---*/
.custom .post_ad { padding: 11px; background: #fff9bc; border-top: 3px solid #ded576; clear: both; }
.custom .post_ad h3 { margin: 0 0 8px 0; padding-bottom: 4px; border-bottom: 1px dotted #c1b95c; }
.custom .post_ad img { display: block; margin-bottom: 11px; margin-left: 11px; border: 8px solid #ebe59e; float: right; }
.custom .post_ad ul { margin-bottom: 0; }
You can change background color to whatever colors you like. The color in this code is YELLOW
Step 3: Make your own ad_box.php file and upload it to your hosting.
Code like this :
<div> <h3>This site runs on the Thesis WordPress Theme</h3> <a href="http://diythemes.com/"><img src="<?php echo THESIS_CUSTOM_FOLDER; ?>/images/thesis-thumb.png" width="184" height="154" alt="Thesis Theme thumbnail" title="Click to see the Thesis demo site!" /></a> <p>If you’re someone who doesn’t understand a lot of <abbr title="recursive acronym for Hypertext Preprocessor">PHP</abbr>, <abbr title="HyperText Markup Language">HTML</abbr>, or <abbr title="Cascading Style Sheet">CSS</abbr>, Thesis will give you a ton of functionality without having to alter any code. For the advanced, Thesis has incredible customization possibilities via extensive hooks and filters. And with so many design options, you can use the template over and over and never have it look like the same site.</p> <p>If you’re more familiar with how websites work, you can use the fantastic Thesis User’s Guide and world-class support forums to make more professional customizations than you ever thought possible. The theme is not only highly customizable, but it allows me to build sites with a much more targeted focus on monetization than ever before. You can find out more about Thesis below:</p> <ul> <li><a href="http://diythemes.com/thesis/">Thesis Blog</a></li> <li><a href="http://diythemes.com/thesis/rtfm/">User’s Guide</a></li> <li><a href="http://diythemes.com/plans/">Plans & Pricing (with a 30-day money back guarantee!)</a></li> </ul> </div>
Just make the code like this,when this file is included after your post,it will use stylesheet in custom.css or style.css
I think this small tutorial is helpful to increase your online earning. Don’t forget to leave some comment.
Thank you for reading and Good luck with your new ad box!
Download Thesis WordPress Theme
Also check out 15 Thesis Theme customization tips.
Subscribe Updates, Its FREE!



→
{ 19 comments }
Great post Tung. Very Useful for thesis users and the box looks really cool
.
Thanks for sharing. Great work.
Thank you!I write this post in the morning and After 4 hours it is published .I am very happy!
Congrats buddy,
You have just placed a deluxe slot ad on the Internet with not much effort. Guest post is still the best but most difficult way to get visitors to your ơn blog, particularly on hight profile blog such as SML.
I will follow you.
Thanks my buddy!
In search of this tutorial, look forward to add this into my blog.
thanks a lot for sharing
Thank you Pumama…. for this article… this will definitely help a lot of users
Simple tip but ‘tip top’!. I like the idea to separate the code in different file. So less mistake that we might do in custom_function.php file.
This is what I’ve been looking for. I have added my box inside custom_functions.php and it looks kind of messy
Thanks.
some how this may gives some idea to non thesis users too… i have added it on my blog…
Congrats @Tung. The same with my previous tut but different way in terms of aff code
Thank you!Your previous tutorial gives me this idea
Not a new tutorial to be honest,
BUt still great that you share with shoutmeloud readers, thanks Tung!
I also applied the same tut from diythemes website.
@Harsh, i notice whenever i visit your blog, my firefox freezes for a few seconds, is it only me or other visitors? If it’s only me then it is fine lol, just don’t want your visitors disappointed.
Thanks.
Kimi.
Hey Kimi
I would look into the issue…
Some one reported my an issue related to IE..
I believe it’s coz of some ad script..
About Firefox, I would wait for 1-2 more report and I will actively look into it….
Harsh,
I have never used IE so no idea with IE,
and I would do the same, thanks.
Kimi.
nice tutorial, very helpful for thesis users…..
Thanks for sharing this tip.
Just tell me can I do the same trick in any wordpress related theme or only in thesis theme ??
Hm,I can’t explain. But I can help you.Pls email me
pumama@techsharing.net
Not work for Genesis