Adding Third Party Opt-In Forms

This document is deprecated! The information on this page refers to a Thesis version that is now obsolete. Please visit the Thesis Docs for current documentation.

Opt-in forms give your site an email list that can be used to send posts, newsletters, special offers, and more.

Adding an opt-in form to Thesis in various locations can be as simple as cut-n-paste, though the code required may depend on what you receive from your opt-in provider.

Opt-In Form Sample For example, Aweber is a popular list management and opt-in form generator. After creating your account, you are given the option to include a single JavaScript file, or to paste your form as HTML code.

If you choose the JavaScript option, you can paste that code directly into your post or page contents. Adding it to certain areas may require the use of a short function.

By way of illustration, to place your opt-in form before the other contents of your sidebars, add this to custom_functions.php:

function my_opt_in_form() { ?>

PASTE YOUR CODE HERE

<?php }

add_action('thesis_hook_before_sidebars','my_opt_in_form');

To place the form elsewhere, use a different Thesis Hook in your function.

If you choose the HTML option, this is merely copy-pasted either inline, or into a custom function such as the above, replacing the single script line with all the HTML code required.

Whatever the delivery method, opt-in forms usually contain HTML and CSS formatting so that they display much as they appeared at the time of creation on the third party site.

Occasionally, input buttons or other specific elements of your opt-in forms will require retouching in custom.css, as in this example:

.custom #YOUR_UNIQUE_FORM_ID input { 
  width:auto; 
  border:1px solid #666; 
  background:none; 
}

In the code above, identifying the form id selector can be done with View Source, the “right-click” inspectors of browsers like Chrome or Safari, and is greatly simplified by Firefox running the Firebug add-on.

Multiple opt-in forms can be created in most of the common third party opt-in plugins and services.