|Topics: WordPress · Subscriptions|
|Experience Level: Intermediate|
|February 28, 2019 · 5 min read|
In this section, we are going to go through one of our most popular features: the Subscription Button. We will walk you through how to create your own subscription (or time pass) button that you can post anywhere on your site - this is perfect for promoting your subscription offer in the header or in pop-ups.
The button is generated using a WordPress shortcode - a WordPress-specific code that lets you do nifty things with very little effort. Shortcodes can embed files or create objects that would normally require lots of complicated, ugly code in just one line. In other words, ‘shortcode’ = ‘shortcut.’
The LaterPay WordPress Plugin provides you with a custom shortcode that allows you to quickly and easily generate a button to promote your LaterPay time pass or subscription.
If one of your viewers clicks the button, they will be taken to the purchase screen just as if they had selected the option from one of our paywalls.
If you are familiar with shortcodes, feel free to skip to the "Shortcode Details" section below; otherwise, here is a quick example to familiarize you with all of the customization options available.
- On the paywall tab, subscriptions and time passes are identified with an ID number. Find the pricing option that you would like to use for your button. For this example we will create a button for our 1 Month Subscription, Sub 8.
- Next, if you don’t want to use our default button (shown at the top of this article), take some time to decide how you would like the button to look.
- For this example, we will have the button say “Subscribe for only $3.99 Now!”
- With an orange background: “#F2902A”
- And light blue-grey text: “LIGHTSLATEGRAY”
- Now let’s map these to the parameters outlined in the "Shortcode Details" section below:
button_text Subscribe for only $3.99 Now! button_background_color #F2902A button_text_color LIGHTSLATEGRAY
- Now that we know what value we want for each parameter, we simply re-write it as a WordPress shortcode:
[laterpay_subscription_purchase id="8" button_text = "Subscribe for only $3.99 Now!" button_background_color="#F2902A" button_text_color= "LIGHTSLATEGRAY"]
- Then I simply copy and paste my shortcode (above) into the Text editor anywhere on my WordPress site and the button (below) will appear when you update your post!
Now that you have seen an example, here are details on all of the different options available. Note that only the first parameter is required; the rest are completely optional.
|This is the ID shown on paywall tab (above). You will either use the time pass code OR the subscription code. Each button can only have one pricing option.||
Note that there are different shortcodes for time passes and subscription; be sure to use the right one!
|button_text||This is the text that you would like to be displayed on the button||Optional|
|button_background_color||This will accept an html color name or hex code||Optional|
|button_text_color||This will accept an html color name or hex code||Optional|
|custom_image_path||Provide the URL of the image||Optional; if you provide a custom image path, the button text and background settings will not be applied|
If your shortcode does not appear to be working:
- On your WordPress installed plugins page, ensure that your LaterPay plugin is on version 2.5.0 or higher; this feature is not available in earlier versions of the plugin.
- Ensure that you are using the correct starting parameter.
[laterpay_time_pass_purchase is required for Time Passes &
[laterpay_subscription_purchase is required for Subscriptions.
Next up, let's take a look at how to charge for downloadable content!