Created
September 5, 2018 20:07
-
-
Save indeedably/5e3f190bd9f0191261b929cecf2ea75d to your computer and use it in GitHub Desktop.
How to add Wordpress Jetpack subscription form using shortcodes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
The Wordpress Jetpack plugin offers a subscription widget that can be added via shortcodes. | |
To enable: | |
1. Open the Wordpress template file (e.g. footer.php) containing the desired location of the widget. | |
These are located in /wp-content/themes/[YOUR THEME]/ | |
2. Paste the code snippet below into your template file in the required location. | |
3. Replace the [PARAMETER n] values with your desired values. | |
4. Save to have the changes take effect. | |
*/ | |
<?php | |
echo do_shortcode('[jetpack_subscription_form title="[PARAMETER TITLE]" subscribe_placeholder="[PARAMETER PLACEHOLDER]" subscribe_text="[PARAMETER TEXT]" subscribe_button="[PARAMETER BUTTON]" success_message="[PARAMETER SUCCESS]"]'); | |
?> | |
/* | |
The available shortcodes are: | |
title - the title of the subscription form, for example "Subscribe to the newsletter" | |
subscribe_text - a line of text above the input box, for example "Sign up for emails" | |
subscribe_placeholder - the placeholder text in the input box, for example "Enter email here" | |
subscribe_button - the text that appears on the submit button, for example "Sign Up" | |
success_message - the text to be displayed upon successful submission of the subscription form, for example "Thanks for subscribing" | |
*/ |
Thank you for writing this!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Example output: