|Topics: WordPress · Downloads|
|Experience Level: Intermediate|
|February 25, 2019 · 7 min read|
Now that you have your WordPress Plugin set up, we want to introduce you to one of our more advanced features – the ability to charge for downloadable content. Although this is one of our more “advanced" features, it is still quite simple to set up thanks to WordPress blocks & shortcodes.
The simplest way to monetize downloadable content in the WordPress Editor is using WordPress's block functionality. In the Editor, simply:
- Click to add a new block
- Scroll down & expand the LaterPay Blocks section or search for the following block
- Select "LaterPay Premium Download Box"
Once you have added the block, configure the settings as desired in the block settings menu displayed along the right side of your screen. Once these are configured, simply update or publish your article to make your changes live!
Using the ShortCode
A quick refresher - according to WordPress.com, a shortcode is 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_premium_download] shortcode allows you to quickly and easily charge for downloadable content. Here’s how:
- Ensure that you have the "Media" content type enabled on the LaterPay Paywall tab
- Upload the downloadable content to the WordPress Media section
- Open the content from within the WordPress Media section
- In the URL there should be text that reads something like “item=138” – take note of that item number
- Click “View attachment page” and then click “Edit” to edit that page. Once you are on the Edit screen – which will look very similar to the Edit Post page – you can set an “Individual Price” which will be the price that a reader must pay to access this piece of content
- Set-up is complete! Now we just need to display the download link on the page. This is done by placing a [ laterpay_premium_download ] shortcode in your post wherever you would like the download widget to appear.
Before we dive into the details, here is an example of what this could look like and the code used to generate it:
heading_text="The State of Paid Content"
description_text="The ad model is broken, the 'pivot to readers' is incomplete, and conditions are right for experimentation."
TIP: If you copy and paste the above shortcode as a starting point, be sure to remove the extra line breaks.
Now that you have seen an example, here are details on all of the different options available. It’s worth noting that the only thing that is required is the target_post_id, which lets LaterPay know what you want to sell. Everything else is completely optional.
|target_post_id||The WordPress id of the page that contains the paid content||REQUIRED; see step 4 above for more details|
|heading_text||The text that should be displayed as a heading in the teaser box; restricted to one line||Optional|
|description_text||Text that provides additional information on the paid content; restricted to a maximum of three lines||Optional|
|content_type||Choose between ‘text’, ‘music’, ‘video’, ‘gallery’, ‘file’, or ‘link’ to display the corresponding teaser image (examples below)||Optional; will be overwritten if a teaser_image_path is provided|
|teaser_image_path||Path to an image that should be used instead of the default LaterPay teaser image||
Optional; detailed instructions below
content_type & teaser_image_path examples
image to display
(default if both content_type & teaser_image_path are left blank, the image will default to ‘file’)
To add a custom image as is done in the provided example:
For example: if the URL for the image in the example above were
If your [laterpay_premium_download] shortcode is not working, use the WordPress HTML tool to ensure that there is no HTML or line breaks inside your shortcode. If either of these are into your shortcode, simply remove them; that should do the trick!
Next up, let’s take a look at another example - creating a paid video or podcast!