1. Home
  2. Advanced
  3. Adding Custom JavaScript to WP Simple Pay

Adding Custom JavaScript to WP Simple Pay

This article recommends adding custom code to your WordPress site and is intended for developers. Although we don’t provide custom development services ourselves, if you need help we highly recommend Codeable for one-time projects and WP Buffs for ongoing development, support, and maintenance. Both have people familiar with both Stripe and WP Simple Pay.

Do you need to add custom JavaScript to a WP Simple Pay payment form, such as to trigger the Stripe Checkout overlay from custom buttons outside the form itself?

Here are a few ways to add custom JavaScript to your site:

  1. Add JS inline to your theme’s footer file (footer.php).
  2. Add a separate JS file to your theme and use the wp_enqueue_script function to reference it in your functions.php or a separate custom plugin.
  3. Use a 3rd party plugin made for injecting custom JS to your site. This method doesn’t involve modifying your theme or creating a separate plugin. We like Insert Headers and Footers and Scripts n Styles. The latter allows you to add JS only to specific pages if needed.

If you need to remove the plugin scripts completely find out how with our snippet library.

Updated on June 12, 2017

Was this article helpful?

Related Articles