Quantcast
Channel: Jupiter Jim's Marketing Team » Thesis Theme Video Tutorials
Viewing all articles
Browse latest Browse all 5

Thesis Tutorial: Automatically Add Affiliate Banner After Blog Post Content

$
0
0

This Thesis Tutorial shows you how to add an affiliate banner or advertisement at the end of every blog post that is on a page all by itself (a single post per page).   Typically, you see blog posts on the home page or on the blog page and you are looking at the “blog loop” which are a string of the latest blog posts.   You will NOT see see the affiliate advertisement or banner at the end of the content of these posts that are on the front page.

Single Post per Page

You will only see the affiliate banners and advertisements if you click on the blog post so that you end up with just that ONE BLOG POST on ONE PAGE.  That is what I am showing you how to do in this video and with the PHP code that I have included in this blog post.   If you would like to find the PHP code to add the affiliate banner at the end of the content of a blog post on the home page or at the end of WordPress blog Pages NOT just WordPress blog Posts, then you should click on this link to the DIYThemes.com website which is where I got to code I used in this video.

Backup the custom_functions.php file

Before you paste the following code into the custom_functions.php file, you MUST backup your custom_functions.php or it could end up being a very bad day for you.  If you leave out one little semi-colon (;) or character in the code,  you may lose access to your site.  With a backup and an FTP connection, you are back in business in minutes. Without a backup, your nightmare has just begun.

Click here for my Thesis Theme Video Tutorial on How to Backup the custom_functions.php file.

Code for the custom_functions.php file

Ok, now below is the code I use in the video which you are required to paste into the custom_functions.php file.

/* START of Affiliate Link After Post */

function single_post_ads() {

if (is_single()) { ?>

// INSERT Affiliate Link Code Here

<?php }

}

add_action('thesis_hook_after_post', 'single_post_ads');

/* END of Affiliate Link After Post */

And here’s the video showing you how to do it:


Viewing all articles
Browse latest Browse all 5

Trending Articles