WP Stripe
[resolved] Shortcode not adding necessary thickbox js or css, only in sidebar (3 posts)

  1. joelandrewbrown
    Posted 3 years ago #

    I have two examples here:

    Ex. 1:
    This page has the [wp-stripe] shortcode in the main content as well in the sidebar. This example works just fine, including the proper css and js for the donate pop up to work properly.

    Ex. 2:
    This page only has the [wp-stripe] included in the sidebar (click the 2nd Donate now button from the top). You'll notice in this example that the popup does not work. This is because, for some reason, the css and js are not being included.

    We've tried de-activating all other plugins. We've confirmed that in Ex. 2, if we put a [wp-stripe] in the main content, then both start working.

    Any ideas why the proper css and js are not included when the [wp-stripe] shortcode is only in the sidebar?

    Thanks in advance! This plugin is great, this is the only trip-up we've had so far.


  2. joelandrewbrown
    Posted 3 years ago #

    So, we figured out our particular issue. On line 108 of wp-stripe.php:


    is wrapped in

    if (is_singular() && strpos($post->post_content,'stripe') !== false) {

    In our case, removing the if statement allowed the donate pop up (in the sidebar) to function properly. I can't explain exactly why, any ideas? We were curious what the purpose of that if statement was exactly.

    Thanks for the awesome plugin!

  3. Noel Tock
    Human Made
    Plugin Author

    Posted 3 years ago #

    Hi Joel,

    Good job on replying before me :) Basically the if statement serves to check if the post content contains the word stripe, so that everything is only loaded on the necessary pages (though I could probably do a better job to make it compatible with widgets too). Will fix in the next release!



Topic Closed

This topic has been closed to new replies.

About this Plugin

  • WP Stripe
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic