Title: Weird Theme Error
Last modified: August 20, 2016

---

# Weird Theme Error

 *  Resolved [genesteinberg](https://wordpress.org/support/users/genesteinberg/)
 * (@genesteinberg)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/weird-theme-error/)
 * Since version 1.7, I have been unable to use this plugin. I get this message 
   where the button is supposed to appear:
 * Fatal error: Class ‘paypal_donations’ not found in /home/technigh/public_html/
   wp-content/themes/technightowl/single.php on line 47
 * The section referenced has something inserted by a theme designer with whom I
   have no present contact.
 *  <?php
    $paypal = new paypal_donations(); $atts=”; echo $paypal->paypal_shortcode(
   $atts); ?>
 * What do I change to get your shortcode to function?
 * Peace,
    Gene
 * [http://wordpress.org/extend/plugins/paypal-donations/](http://wordpress.org/extend/plugins/paypal-donations/)

Viewing 4 replies - 1 through 4 (of 4 total)

 *  Plugin Contributor [Johan Steen](https://wordpress.org/support/users/artstorm/)
 * (@artstorm)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/weird-theme-error/#post-3546999)
 * Hi Gene,
 * The class has changed name since v1.7, so it’s now called `PayPalDonations()`
   instead of `paypal_donations()`. And it’s now a Singleton class, so if it’s already
   been initiated (which it has by the plugin system, it shouldn’t be started with
   a new)
 * If the theme is calling the plugin directly you need to modify the code you posted
   above slightly. Also the method to generate the shortcode has changed name from`
   paypal_shortcode()` to `paypalShortcode()`.
 * Modifying your block of code to this, should do the trick for you:
 *     ```
       <?php
           $paypal = PayPalDonations::getInstance();
           $atts='';
           echo $paypal->paypalShortcode($atts);
       ?>
       ```
   
 * Cheers,
    Johan
 *  Thread Starter [genesteinberg](https://wordpress.org/support/users/genesteinberg/)
 * (@genesteinberg)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/weird-theme-error/#post-3547006)
 * Maybe, but now it says:
 * Fatal error: Call to private PayPalDonations::__construct() from invalid context
   in /home/technigh/public_html/wp-content/themes/technightowl/single.php on line
   47
 * Peace,
    Gene
 *  Plugin Contributor [Johan Steen](https://wordpress.org/support/users/artstorm/)
 * (@artstorm)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/weird-theme-error/#post-3547009)
 * Gene, I just modified my reply above, with a code change. As I just realized 
   that `new` won’t work anymore either when calling the plugin code from outside
   the plugin. So try the code above now.
 * Cheers,
    Johan
 *  Thread Starter [genesteinberg](https://wordpress.org/support/users/genesteinberg/)
 * (@genesteinberg)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/weird-theme-error/#post-3547011)
 * OK, we’re good now.
 * Thanks.
 * Peace,
    Gene

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Weird Theme Error’ is closed to new replies.

 * ![](https://ps.w.org/paypal-donations/assets/icon.svg?rev=994082)
 * [Donations via PayPal](https://wordpress.org/plugins/paypal-donations/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/paypal-donations/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/paypal-donations/)
 * [Active Topics](https://wordpress.org/support/plugin/paypal-donations/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/paypal-donations/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/paypal-donations/reviews/)

 * 4 replies
 * 2 participants
 * Last reply from: [genesteinberg](https://wordpress.org/support/users/genesteinberg/)
 * Last activity: [13 years, 2 months ago](https://wordpress.org/support/topic/weird-theme-error/#post-3547011)
 * Status: resolved