Add Affiliate Disclosure To All Posts

Method 1: Genesis Themes (Simple Hooks or functions.php edit)
Method 2: Plugins (Ad Inserter or WWSGD)
Method 3: Theme Template Edit

Method 1: Genesis Simple Hooks

Most users needing this disclosure are likely on Genesis framework, and likely have Genesis Simple Hooks installed, so this will be very easy to use for an automatic affiliate disclosure added to post:

1.) Go in wp-admin to Genesis>Simple Hooks.
2.) In Simple Hooks, scroll down to the box “genesis_before_entry_content Hook”
3.) Add the disclosure code, turn on the checkbox for PHP, save Simple Hooks settings:

<?php if ( is_singular( 'post' ) ) {
  echo '<p>As an Amazon Associate I earn from qualifying purchases.</p>';
} ?>

Here’s how it looks in my Simple Hooks:

easy 🙂

For a styled disclosure you might add a class or div to target the disclosure in your stylesheets like this:

<?php if ( is_singular( 'post' ) ) {
  echo '<div class="disclosure"><p>As an Amazon Associate I earn from qualifying purchases.</p></div>';
} ?>

Which you could then pair with css to make the disclosure look however you like, such as this (add to your theme stylesheet, or the WP Customizer available in wp-admin at Appearance>Customize>Additional CSS):

.disclosure {padding:5px; margin:5px; border:thin dotted #000;}
.disclosure p {font-style: italic; font-size: 15px;text-align:center;}
The result of the above css on the now-stylized disclosure.

Method 1: Genesis functions.php file edit

Go in wp-admin to Appearance>Theme Editor, open the functions.php file, scroll to the bottom of the file, on a new line paste this code, save file:

add_action( 'genesis_entry_content', 'wpt_disclosure', 1 );
function wpt_disclosure() {
  if ( is_singular( 'post' ) ) {
    echo '<p>This post may contain affiliate links. I receive a small commission at no cost to you when you make a purchase using my link.</p>';
  }
}

Method 2: Plugins (Ad Inserter or WWSGD)

Many people already have Ad Inserter plugin (popularly used by Adthrive), so it could be a great option if it’s already installed. Just go to ad inserter (wp-admin>Settings>Ad Inserter) and open a new code inserter tab:

Config is simple, just follow the arrows 🙂

If you don’t already have Ad Inserter, and you want something a little more lightweight, then you might consider WWSGD plugin which is very very simple for adding something to the top of posts. Once installed just head over to the config page at wp-admin>Settings>WWSGD and:

It’s simple 🙂

Method 3: Theme Template Edit

Coming soon!

Leave a Comment